Chr*_*ris 8 animation uianimation ios swift
我有以下自定义过渡使用UIView.animateWithDuration(...usingSpringWithDamping:...)
,它完美地工作.
UIView.animateWithDuration(self.transitionDuration(transitionContext),
delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 1.0,
options: nil, animations: {() in
// ...
}, completion: {(Bool) in
// ...
})
Run Code Online (Sandbox Code Playgroud)
但后来我不得不扩展我的自定义转换,UIViewControllerInteractiveTransitioning
以便进行交互式转换,用户可以再次向下滑动模态视图.
因此,我需要动画的关键帧才能UIPercentDrivenInteractiveTransition
正常工作.
所以我改变了动画功能UIView.animateWithKeyframes...
.
UIView.animateKeyframesWithDuration(self.transitionDuration(transitionContext),
delay: 0.0, options: UIViewKeyframeAnimationOptions.CalculationModeCubic,
animations: {() in
// ...
}, completion: {(Bool) in
// ...
})
Run Code Online (Sandbox Code Playgroud)
我现在的问题是:我丢失了弹簧动画.
我查了几个链接,其中最有希望的是:
...但是使用.addKeyframes...
方法我无法指定我需要的完成块.
有什么建议?: - /