diff --git a/Example/UnderLineTextField-Example.xcodeproj/project.pbxproj b/Example/UnderLineTextField-Example.xcodeproj/project.pbxproj index 0821066..7ec847d 100644 --- a/Example/UnderLineTextField-Example.xcodeproj/project.pbxproj +++ b/Example/UnderLineTextField-Example.xcodeproj/project.pbxproj @@ -359,6 +359,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = DF298Y52D4; INFOPLIST_FILE = "UnderLineTextField-Example/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mohammadalijf.UnderLineTextField-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -375,6 +376,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = DF298Y52D4; INFOPLIST_FILE = "UnderLineTextField-Example/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mohammadalijf.UnderLineTextField-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Example/UnderLineTextField-Example.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate b/Example/UnderLineTextField-Example.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate index 0e1f3aa..3f02cb0 100644 Binary files a/Example/UnderLineTextField-Example.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate and b/Example/UnderLineTextField-Example.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Example/UnderLineTextField-Example/Base.lproj/Main.storyboard b/Example/UnderLineTextField-Example/Base.lproj/Main.storyboard index 66f7a5a..840be02 100644 --- a/Example/UnderLineTextField-Example/Base.lproj/Main.storyboard +++ b/Example/UnderLineTextField-Example/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -22,10 +22,10 @@ - + - + @@ -35,7 +35,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -127,7 +127,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -290,7 +290,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -341,7 +341,7 @@ - + @@ -382,7 +382,7 @@ - + @@ -392,7 +392,7 @@ - + @@ -433,7 +433,7 @@ - + @@ -443,7 +443,7 @@ - + diff --git a/Example/UnderLineTextField-Example/Info.plist b/Example/UnderLineTextField-Example/Info.plist index 16be3b6..9213f39 100644 --- a/Example/UnderLineTextField-Example/Info.plist +++ b/Example/UnderLineTextField-Example/Info.plist @@ -33,6 +33,7 @@ UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad diff --git a/Source/UnderLineTextField.xcodeproj/project.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate b/Source/UnderLineTextField.xcodeproj/project.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate index ee44965..64950bd 100644 Binary files a/Source/UnderLineTextField.xcodeproj/project.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate and b/Source/UnderLineTextField.xcodeproj/project.xcworkspace/xcuserdata/mohammadalijf.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Source/UnderLineTextField/Supporting Files/Info.plist b/Source/UnderLineTextField/Supporting Files/Info.plist index f936f8d..f841d8f 100644 --- a/Source/UnderLineTextField/Supporting Files/Info.plist +++ b/Source/UnderLineTextField/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.3 + 2.0.4 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Source/UnderLineTextField/UnderLineTextField.swift b/Source/UnderLineTextField/UnderLineTextField.swift index d18b7e1..5a7642c 100644 --- a/Source/UnderLineTextField/UnderLineTextField.swift +++ b/Source/UnderLineTextField/UnderLineTextField.swift @@ -82,21 +82,6 @@ open class UnderLineTextField: UITextField { /// validation time type open var validationType: UnderLineTextFieldValidateType = .afterEdit - /// text color of placeholder - var placeholderColor: UIColor! { - switch (status, contentStatus, focusStatus) { - case (.normal, .empty, .inactive): - return inactivePlaceholderTextColor - case (.normal, .empty, .active): - return activePlaceholderTextColor - case ((.error,_,_)): - return errorPlaceholderColor - case ((.warning,_,_)): - return warningPlaceholderColor - default: - return inactivePlaceholderTextColor - } - } /// animation duration for changing states open var animationDuration: Double = 0.3 /// constraints that will be activated upon initilization @@ -115,9 +100,9 @@ open class UnderLineTextField: UITextField { /// current color of control base on it's status private var lineColor: UIColor { switch (status, contentStatus, focusStatus) { - case (.normal, .empty, .inactive): + case (.normal, _, .inactive): return inactiveLineColor - case (.normal, .empty, .active): + case (.normal, _, .active): return activeLineColor case ((.error,_,_)): return errorLineColor @@ -130,9 +115,9 @@ open class UnderLineTextField: UITextField { /// current width of control line base on it's status private var lineWidth: CGFloat { switch (status, contentStatus, focusStatus) { - case (.normal, .empty, .inactive): + case (.normal, _, .inactive): return inactiveLineWidth - case (.normal, .empty, .active): + case (.normal, _, .active): return activeLineWidth case ((.error,_,_)): return errorLineWidth @@ -143,6 +128,22 @@ open class UnderLineTextField: UITextField { } } + /// text color of placeholder + var placeholderColor: UIColor! { + switch (status, contentStatus, focusStatus) { + case (.normal, .filled, _): + return activePlaceholderTextColor + case (.normal, .empty, _): + return inactivePlaceholderTextColor + case ((.error,_,_)): + return errorPlaceholderColor + case ((.warning,_,_)): + return warningPlaceholderColor + default: + return inactivePlaceholderTextColor + } + } + //===================== // MARK: Lazy Loadings //===================== diff --git a/UnderLineTextField.podspec b/UnderLineTextField.podspec index a41cb1e..d784460 100644 --- a/UnderLineTextField.podspec +++ b/UnderLineTextField.podspec @@ -4,7 +4,7 @@ s.platform = :ios s.ios.deployment_target = "9.0" s.requires_arc = true s.module_name = "UnderLineTextField" -s.version = "2.0.3" +s.version = "2.0.4" s.summary = "Simple UITextfield Subclass with state" s.description = "simple UITextField subclass with state and floating placeholder" s.homepage = "https://github.com/mohammadalijf/UnderLineTextField"