我想更改导航控制器的默认转换,即 从 左到右 至 右到左 当按下视图控制器时,当我按下后退按钮然后再次更改导航控制器的默认转换,即 从 右到左 至 从左到右
self.navigationController?.pushViewController(currentViewController, animated: false)
答案 0 :(得分:1)
使用此代码示例:
let transition = CATransition()
transition.duration = 0.8
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFromRight // kCATransitionFromLeft
self.navigationController?.view.layer.addAnimation(transition, forKey: nil)
self.navigationController?.pushViewController(currentViewController, animated: yes)