diff --git a/UIAnimatedTextField/Source/UIAnimatedTextField.swift b/UIAnimatedTextField/Source/UIAnimatedTextField.swift index f109ada..f60e096 100644 --- a/UIAnimatedTextField/Source/UIAnimatedTextField.swift +++ b/UIAnimatedTextField/Source/UIAnimatedTextField.swift @@ -40,6 +40,11 @@ public enum TextType { @IBDesignable public class UIAnimatedTextField: UIView { + // MARK: - Constants + struct Constants { + static let done = "Done" + } + // MARK: - Delegate weak public var delegate: UIAnimatedTextFieldDelegate? @@ -163,11 +168,12 @@ public class UIAnimatedTextField: UIView { set { lineView.backgroundColor = newValue } } - // MARK: - Private Properties - + static public let doneTitle: String = Constants.done static public let animationDuration: TimeInterval = 0.3 static public let disclosureIndicatorWidth = 15.0 + // MARK: - Private Properties + private var tapGestureRecognizer: UITapGestureRecognizer? private var tapAction: ((_ animatedTextField: UIAnimatedTextField) -> Void)? private var isShownInfo: Bool = false @@ -395,7 +401,7 @@ public class UIAnimatedTextField: UIView { toolbar.barTintColor = UIColor.white let spacerItem = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) - let doneItem = UIBarButtonItem(title: "Done", + let doneItem = UIBarButtonItem(title: UIAnimatedTextField.doneTitle, style: .done, target: self, action: #selector(datePickerDoneAction))