I have a datePicker that I want to animate inside and out from below, changing its "upper limit to super top".
I have IBOutlet installed, and on viewDidLoad I am allowed to change the restriction constant.

override func viewDidLoad() {
super.viewDidLoad()
self.datePickerTopConstraint.constant = self.view.frame.size.height
}
However, through IBAction, I am trying to set the constant to a different value, and this is not saved.
@IBAction func showDatePicker() {
UIView.animateWithDuration(0.25, animations: {
() -> Void in
self.datePickerTopConstraint.constant = self.view.frame.size.height - self.datePicker.frame.size.height
self.view.layoutIfNeeded()
})
}
It seems that I can undo this and show the datePicker in the view (in viewDidLoad) and animate it out of sight, but not have the datePicker that appears out of sight (as in the example above) and animate inside the view. What did I miss?
EDIT
- ( - ) 0, , , showDatePicker .