I have been dealing with this problem for about 3 days and finally got a solution. I just added an animation block that gets called after a very small timer
UIView.animateWithDuration(0.5, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 7 , options: .CurveEaseInOut, animations: { self.view.layoutIfNeeded() }){ _ in}
will be
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { self.changeConstraint() } private func changeConstraint(){ UIView.animateWithDuration(0.5, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 7 , options: .CurveEaseInOut, animations: { self.view.layoutIfNeeded() }){ _ in} }
See the magic :)
source share