我正在使用这行代码来关闭我的视图控制器 self.dismiss(animated: true, completion: nil)
,但我不喜欢当前的动画效果。相反,我希望从左侧向右滑动。以下是我尝试测试动画的代码,但没有起作用。
UIView.animate(withDuration: 1.0, delay: 0.0, options: UIViewAnimationOptions.curveEaseIn, animations: {
let transition = CATransition()
transition.duration = 10
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromLeft
self.view.layer.add(transition, forKey: kCATransition)
self.dismiss(animated: false, completion: nil)
}, completion: nil)