I am updating a UIView
with layoutIfNeeded
within an animateWithDuration
block, but the duration is taking much longer than what I have coded. Here is the code:
func showInfoView() {
self.hintConstraint.constant = self.view.frame.height - (self.infoView.frame.height + 260)
self.view.layoutIfNeeded()
infoView.hidden = false
UIView.animateWithDuration(0.2, animations: {
self.view.layoutIfNeeded()
})
}
The animation is taking longer than 0.2 seconds. Even if I set the duration time to 0, which should make the code layout the view without animating, the animation still occurs. Does layoutIfNeeded
automatically have a duration when it's within the animateWithDuration
block? Or am I missing something?