Skip to content

Commit

Permalink
version 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad Ali Jafarian committed Nov 9, 2017
1 parent 6c4f041 commit ed87699
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 42 deletions.
2 changes: 2 additions & 0 deletions Example/UnderLineTextField-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand All @@ -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)";
Expand Down
Binary file not shown.
42 changes: 21 additions & 21 deletions Example/UnderLineTextField-Example/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Example/UnderLineTextField-Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/UnderLineTextField/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.3</string>
<string>2.0.4</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
39 changes: 20 additions & 19 deletions Source/UnderLineTextField/UnderLineTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
//=====================
Expand Down
2 changes: 1 addition & 1 deletion UnderLineTextField.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ed87699

Please sign in to comment.