Dynamically Moving (Animating) a UITextField
问题 I have been trying to animate a UITextField so that its y position increases by 50px. Basically, it moves up by fifty pixels. This is my code: @IBAction func textField(sender: AnyObject) { let x = self.pw.frame.origin.x let y = self.pw.frame.origin.y + 100 UIView.animateWithDuration(0.5, delay: 0, options: nil, animations: { self.pw.frame = CGRectMake(x, y, self.pw.frame.size.width, self.pw.frame.size.height) }, completion: nil) It is in a textField's delegate. This code is run when the