Merge pull request #9 from TouchInstinct/fix/focus-bug
Fix. Bug with no-value after textfield lose it focus
This commit is contained in:
commit
297ef68850
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'UIAnimatedTextField'
|
||||
s.version = '0.1.12'
|
||||
s.version = '0.1.13'
|
||||
s.summary = 'UITextField with animated placeholder'
|
||||
s.description = <<-DESC
|
||||
This custom control can be used as a replacement for UITextField. It comes with 5 different text types: simple, password, url, tappable, date.
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ open class UIAnimatedTextField: UIView {
|
|||
return toolbar
|
||||
}
|
||||
|
||||
private func updateText(from datePicker: UIDatePicker) {
|
||||
fileprivate func updateText(from datePicker: UIDatePicker) {
|
||||
selectedDate = datePicker.date
|
||||
text = datePicker.date.toString(withFormat: dateFormat)
|
||||
}
|
||||
|
|
@ -511,7 +511,11 @@ extension UIAnimatedTextField: UITextFieldDelegate {
|
|||
if textField.text?.characters.count ?? 0 == 0 {
|
||||
setState(toState: .placeholder, duration: UIAnimatedTextField.animationDuration)
|
||||
}
|
||||
|
||||
|
||||
if let datePicker = textField.inputView as? UIDatePicker {
|
||||
updateText(from: datePicker)
|
||||
}
|
||||
|
||||
delegate?.animatedTextFieldDidEndEditing?(self)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue