由于将我的项目升级到swift 3,我的自动布局约束动画无法正常工作; 更具体地说,他们正在抢购新职位而不是动画.
UIView.animate(withDuration: 0.1,
delay: 0.1,
options: UIViewAnimationOptions.curveEaseIn,
animations: { () -> Void in
constraint.constant = ButtonAnimationValues.YPosition.DefaultOut()
self.layoutIfNeeded()
}, completion: { (finished) -> Void in
// ....
})
Run Code Online (Sandbox Code Playgroud)
我知道他们增加了UIViewPropertyAnimator
课程,但还没有尝试.