From de0e9adcabed4a24433d086091665d45840e73af Mon Sep 17 00:00:00 2001 From: Igor Kislyuk Date: Thu, 18 May 2017 22:34:29 +0300 Subject: [PATCH 1/2] Fix. Bug with no-value after textfield lose it focus --- UIAnimatedTextField/Source/UIAnimatedTextField.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UIAnimatedTextField/Source/UIAnimatedTextField.swift b/UIAnimatedTextField/Source/UIAnimatedTextField.swift index 359334b..814bd6f 100644 --- a/UIAnimatedTextField/Source/UIAnimatedTextField.swift +++ b/UIAnimatedTextField/Source/UIAnimatedTextField.swift @@ -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) } From cba697954bb6aefece7b65f7169fd35fc1579779 Mon Sep 17 00:00:00 2001 From: Igor Kislyuk Date: Thu, 18 May 2017 22:35:17 +0300 Subject: [PATCH 2/2] Fix. Update pod spec --- UIAnimatedTextField.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIAnimatedTextField.podspec b/UIAnimatedTextField.podspec index 42c4c23..3b94d90 100644 --- a/UIAnimatedTextField.podspec +++ b/UIAnimatedTextField.podspec @@ -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.