diff --git a/FloatLabelExample/FloatLabelExample.xcodeproj/project.pbxproj b/FloatLabelExample/FloatLabelExample.xcodeproj/project.pbxproj index 87413f9..a30856b 100644 --- a/FloatLabelExample/FloatLabelExample.xcodeproj/project.pbxproj +++ b/FloatLabelExample/FloatLabelExample.xcodeproj/project.pbxproj @@ -119,7 +119,7 @@ TargetAttributes = { DD72F5E61A2845270097D54A = { CreatedOnToolsVersion = 6.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0910; }; }; }; @@ -276,7 +276,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.farook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -288,7 +289,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.farook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/FloatLabelFields/FloatLabelTextField.swift b/FloatLabelFields/FloatLabelTextField.swift index 57c9462..4930c61 100644 --- a/FloatLabelFields/FloatLabelTextField.swift +++ b/FloatLabelFields/FloatLabelTextField.swift @@ -21,11 +21,11 @@ import UIKit // MARK:- Properties override var accessibilityLabel:String? { get { - if let txt = text , txt.isEmpty { + if let txt = text, txt.isEmpty { return title.text - } else { - return text } + return text + } set { self.accessibilityLabel = newValue @@ -177,7 +177,7 @@ import UIKit fileprivate func showTitle(_ animated:Bool) { let dur = animated ? animationDuration : 0 - UIView.animate(withDuration: dur, delay:0, options: [UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseOut], animations:{ + UIView.animate(withDuration: dur, delay:0, options: [.beginFromCurrentState, .curveEaseOut], animations:{ // Animation self.title.alpha = 1.0 var r = self.title.frame @@ -188,7 +188,7 @@ import UIKit fileprivate func hideTitle(_ animated:Bool) { let dur = animated ? animationDuration : 0 - UIView.animate(withDuration: dur, delay:0, options: [UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseIn], animations:{ + UIView.animate(withDuration: dur, delay:0, options: [.beginFromCurrentState, .curveEaseIn], animations:{ // Animation self.title.alpha = 0.0 var r = self.title.frame diff --git a/FloatLabelFields/FloatLabelTextView.swift b/FloatLabelFields/FloatLabelTextView.swift index 3b24ae5..4421115 100644 --- a/FloatLabelFields/FloatLabelTextView.swift +++ b/FloatLabelFields/FloatLabelTextView.swift @@ -191,7 +191,7 @@ import UIKit fileprivate func showTitle(_ animated:Bool) { let dur = animated ? animationDuration : 0 - UIView.animate(withDuration: dur, delay:0, options: [UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseOut], animations:{ + UIView.animate(withDuration: dur, delay:0, options: [.beginFromCurrentState, .curveEaseOut], animations:{ // Animation self.title.alpha = 1.0 var r = self.title.frame @@ -202,7 +202,7 @@ import UIKit fileprivate func hideTitle(_ animated:Bool) { let dur = animated ? animationDuration : 0 - UIView.animate(withDuration: dur, delay:0, options: [UIViewAnimationOptions.beginFromCurrentState, UIViewAnimationOptions.curveEaseIn], animations:{ + UIView.animate(withDuration: dur, delay:0, options: [.beginFromCurrentState, .curveEaseIn], animations:{ // Animation self.title.alpha = 0.0 var r = self.title.frame