I am doing some animation on two UITextFields. When one text field is done with editing, I use UIView.animateWithDuration
to animate the first text field to the left, and another call to UIView.animateWithDuration
to show the second text field for editing.
The problem is, when I call becomeFirstResponder()
on the second text field, it reverts the new x/y coordinates on the first ui text field.
Whats going on?
EDIT
Code provided
func animateMe() {
UIView.animateWithDuration(0.5, delay: 0, options: .CurveEaseOut, animations: {
self.onText.frame.offset(dx: self.onText.frame.size.width / -4 * 3 - 10, dy: 0)
}, completion: { finished in
println("one shown!")
self.oneText.frame.offset(dx: self.onText.frame.size.width / -4 * 3 - 10, dy: 0)
self.twoText.becomeFirstResponder() //undoes the whole animation
})
}