I'm creating an iOS app with Swift and I'd like to create custom segue which transitions from right to left. The default transition way is from left to right but I do need to have the opposite way of transition. I just wrote the code like this.
class RightToLeftSegue: UIStoryboardSegue {
override func perform() {
let sourceViewController = self.sourceViewController
let destinationViewController = self.destinationViewController
let window = UIApplication.sharedApplication().keyWindow
window!.rootViewController = destinationViewController
window!.rootViewController = sourceViewController
UIView.transitionWithView(window!, duration: 0.5, options: .TransitionFlipFromLeft, animations: { window!.rootViewController = destinationViewController }, completion: { (finished: Bool) in })
}
}
But this just transitions flipping move. Any way I can do this? Thanks!