Dismiss view controller with custom animation?

后端 未结 1 695
予麋鹿
予麋鹿 2020-12-30 10:51

I am using this line of code to dismiss my view controller self.dismiss(animated: true, completion: nil), but I do not like the current animation. Instead I wan

相关标签:
1条回答
  • 2020-12-30 11:34
    let transition: CATransition = CATransition()
    transition.duration = 0.5
    transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
    transition.type = CATransitionType.reveal
    transition.subtype = CATransitionSubtype.fromRight
    self.view.window!.layer.add(transition, forKey: nil)
    self.dismiss(animated: false, completion: nil)
    
    0 讨论(0)
提交回复
热议问题