I’ve finished the CustomLoginDemo and I wanted to add the ability to go back from the SignInViewControler to the Root View Controller.
I’ve added a Swipe Gesture Recognizer and implemented that into my SignInViewcontroller with the action func ‘swipeRight’.
I’m not quite sure how to implement the transition from the SignInViewController back to the view controller with a swipe right along with the corresponding animation.
I’ve done it with the standard ‘show’ before, however, the animation is the opposite of what I’m looking for - swiping right scrolls the root view controller in from the right instead of the left, which looks more natural.
Any idea how to switch this segue animation? I’ve Googled and Youtubed for hours to no avail, along with searching these forums.
EDIT: Upon further review, it looks like I’ll have to create a custom segue and use that?
The first VC is linked to a navigation controller as per the early instructions in the CustomLoginDemo video. I’m able to navigate forward from the Login/Signup page (root view controller) to the SignUpViewController, however, I can’t go back with the correct animation. I’d like to add the ability to swipe back with the correct segue animation.
As I said in my post, I’m able to swipe and return, it’s the segue animation that’s incorrect.
Then I headed over to my Story Board and CTRL + Dragged the View Controller (in documents outline) to the ‘Exit’ object and selected unwind: segue, naming it ‘unwindToRootVC’.
Then I went back to the Origin View Controller class and wrote out the action function to perform the unwind segue which I then implemented within the Swipe Gesture Action function which follows it.