反转SWIFT中导航控制器的默认转换

时间:2016-06-09 07:03:21

标签: ios swift uinavigationcontroller

我想更改导航控制器的默认转换,即 从 左到右 至 右到左 当按下视图控制器时,当我按下后退按钮然后再次更改导航控制器的默认转换,即 从 右到左 至 从左到右

self.navigationController?.pushViewController(currentViewController, animated: false)

1 个答案:

答案 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)