Quantcast
Channel: How do I animate constraint changes? - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by Edoardo Vicoli for How do I animate constraint changes?

$
0
0

Working and just tested solution for Swift 3 with Xcode 8.3.3:

self.view.layoutIfNeeded()self.calendarViewHeight.constant = 56.0UIView.animate(withDuration: 0.5, delay: 0.0, options: UIViewAnimationOptions.curveEaseIn, animations: {        self.view.layoutIfNeeded()    }, completion: nil)

Just keep in mind that self.calendarViewHeight is a constraint referred to a customView (CalendarView). I called the .layoutIfNeeded() on self.view and NOT on self.calendarView

Hope this help.


Viewing all articles
Browse latest Browse all 13

Trending Articles