Commit 9f8578ff by Daniel Dahan

fixed TextField animation

parent c05511dc
...@@ -640,14 +640,18 @@ public class TextField : UITextField { ...@@ -640,14 +640,18 @@ public class TextField : UITextField {
/// Hides and animates the titleLabel property. /// Hides and animates the titleLabel property.
private func hideTitleLabel() { private func hideTitleLabel() {
let h: CGFloat = ceil(titleLabel.font.lineHeight)
UIView.animateWithDuration(0.1, animations: { [unowned self] in
self.titleLabel.frame = self.bounds
}) { [unowned self] _ in
UIView.animateWithDuration(0.15, animations: { [unowned self] in UIView.animateWithDuration(0.15, animations: { [unowned self] in
self.titleLabel.font = self.font self.titleLabel.font = self.font
self.titleLabel.frame = self.bounds
}) { [unowned self] _ in }) { [unowned self] _ in
self.placeholder = self.placeholderText self.placeholder = self.placeholderText
self.titleLabel.hidden = true self.titleLabel.hidden = true
} }
} }
}
/// Shows and animates the detailLabel property. /// Shows and animates the detailLabel property.
private func showDetailLabel() { private func showDetailLabel() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment