Add done title as property

This commit is contained in:
Ivan Zinovyev 2016-12-19 18:23:59 +03:00
parent 222db00731
commit 779290d1d6
1 changed files with 9 additions and 3 deletions

View File

@ -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))