UIView changing its position in swift
问题 How do I make a UIView slide up with a touch of a button from its original position and them bring it back down with a touch of a button? Using Swift and Xcode 6. I have currently tried this: @IBOutlet weak var DynView: UIView! @IBAction func btnUp(sender: AnyObject) { } 回答1: You have to implement an animation changing the DynView position on click. Here's an example: @IBAction func btnUp(sender: AnyObject) { let xPosition = DynView.frame.origin.x let yPosition = DynView.frame.origin.y - 20 /