Commit 84d242e3 by Daniel Dahan

development: completed rework for TextField

parent 55625112
......@@ -107,7 +107,6 @@
TargetAttributes = {
96090AE31D9CDD2E00709CA6 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 9Z76XCNLGL;
ProvisioningStyle = Automatic;
};
};
......@@ -263,7 +262,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 9Z76XCNLGL;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TextField/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TextField;
......@@ -276,7 +275,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 9Z76XCNLGL;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TextField/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TextField;
......
......@@ -41,11 +41,11 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
view.backgroundColor = Color.grey.lighten5
prepareNameField()
prepareEmailField()
// preparePasswordField()
preparePasswordField()
prepareResignResponderButton()
}
......@@ -75,7 +75,6 @@ class ViewController: UIViewController {
nameField.placeholder = "Name"
nameField.detail = "Your given name"
nameField.isClearIconButtonEnabled = true
nameField.clearButtonMode = .whileEditing
let leftView = UIImageView()
leftView.image = Icon.phone?.tint(with: Color.blue.base)
......
......@@ -184,6 +184,10 @@ open class SearchBar: Bar {
/// Clears the textField text.
@objc
internal func handleClearButton() {
guard nil == textField.delegate?.textFieldShouldClear || true == textField.delegate?.textFieldShouldClear?(textField) else {
return
}
let t = textField.text
delegate?.searchBar?(searchBar: self, willClear: textField, with: t)
......
......@@ -258,7 +258,7 @@ open class TextField: UITextField {
}
clearIconButton = IconButton(image: Icon.cm.clear, tintColor: placeholderNormalColor)
clearIconButton!.contentEdgeInsets = .zero
clearIconButton!.contentEdgeInsetsPreset = .none
clearIconButton!.pulseAnimation = .none
clearButtonMode = .never
rightViewMode = .whileEditing
......@@ -304,7 +304,7 @@ open class TextField: UITextField {
}
visibilityIconButton = IconButton(image: Icon.visibility, tintColor: placeholderNormalColor.withAlphaComponent(isSecureTextEntry ? 0.38 : 0.54))
visibilityIconButton!.contentEdgeInsets = .zero
visibilityIconButton!.contentEdgeInsetsPreset = .none
visibilityIconButton!.pulseAnimation = .none
isSecureTextEntry = true
clearButtonMode = .never
......@@ -412,7 +412,7 @@ open class TextField: UITextField {
/// Handles the clearIconButton TouchUpInside event.
@objc
open func handleClearIconButton() {
guard true == delegate?.textFieldShouldClear?(self) else {
guard nil == delegate?.textFieldShouldClear || true == delegate?.textFieldShouldClear?(self) else {
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment