I\'ve read the other posts on segues but none solve my question.
Simply put, my ViewControllers are ordered, like a book. I want backward transitions (
To create a "back button" like animation, use this.
class SegueRightToLeft: UIStoryboardSegue {
override func perform() {
let src = self.source //new enum
let dst = self.destination //new enum
src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)
dst.view.transform = CGAffineTransform(translationX: -src.view.frame.size.width/2, y: 0)
//slice the x axis translation in half
UIView.animate(withDuration: 0.25, delay: 0.0, options: UIViewAnimationOptions.curveEaseInOut, animations: {
dst.view.transform = CGAffineTransform(translationX: 0, y: 0)
}) { (finished) in
src.present(dst, animated: false, completion: nil)
}
}