class Example: NSObject, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate {
var aView : UIView!
UIView.animateWithDuration(duration, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.8, options: nil, animations: {
self.aView.transform = CGAffineTransformIdentity //This line is throwing the error mentioned in the Title
}, completion: { finished in
transitionContext.completeTransition(true)
})
}
这是在Swift的早期版本中工作但在版本2中失败并不确定原因
答案 0 :(得分:5)
你只需要改变
UIView.animateWithDuration(duration,
delay: 0.0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0.8,
options: nil,
animations: {
with:
UIView.animateWithDuration(duration,
delay: 0.0,
usingSpringWithDamping: 0.8,
initialSpringVelocity: 0.8,
options: [],
animations: {
只有“选项”可以改变。