我使用UIView.animateWithDuration(...usingSpringWithDamping:...)
完成了以下自定义转换。
UIView.animateWithDuration(self.transitionDuration(transitionContext),
delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 1.0,
options: nil, animations: {() in
// ...
}, completion: {(Bool) in
// ...
})
但是我必须使用UIViewControllerInteractiveTransitioning
扩展我的自定义转换,以便进行交互式转换,用户可以再次向下滑动模式视图。
因此,我需要动画的关键帧,以便UIPercentDrivenInteractiveTransition
正常工作。
所以我改变了动画功能以使用UIView.animateWithKeyframes...
。
UIView.animateKeyframesWithDuration(self.transitionDuration(transitionContext),
delay: 0.0, options: UIViewKeyframeAnimationOptions.CalculationModeCubic,
animations: {() in
// ...
}, completion: {(Bool) in
// ...
})
我现在的问题:我丢失了弹簧动画。
我查了几个链接,其中最有希望的是:
...但是使用.addKeyframes...
方法我无法指定我需要的完成块。
有什么建议吗? : - /