I want to change the direction when I pop a view controller. Below is the code I am using. I want to pop the controller from right (just a opposite direction when push a view controller) but it doesn't work. It just fade out gradually. How can I make the animation to be fading out from the right?
let transition = CATransition()
transition.duration = 0.3
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
transition.type = kCATransitionFromRight
self.navigationController?.view.layer.addAnimation(transition, forKey: nil)
self.navigationController?.popToRootViewControllerAnimated(false)