popViewControllerAnimated: custom transition animation?

后端 未结 3 1388
醉话见心
醉话见心 2020-12-17 00:33

Yes, I have looked for an answer already. None of the solutions work, except one that doesn\'t give the option for a fade transition, only flip or curl.

Like this:

3条回答
  •  猫巷女王i
    2020-12-17 00:36

    Joris Kluivers's answer in Swift 3 :

    CATransaction.begin()
    CATransaction.setDisableActions(true)
    
    let animation = CATransition()
    animation.type = kCATransitionFade
    self.navigationController?.view.layer.add(animation, forKey: "someAnimation")
    _ = self.navigationController?.popViewController(animated: false)
    
    CATransaction.commit()
    

提交回复
热议问题