Assign the class UIStoryboardSegueFromRight to the custom segue in the storyboard.
To create an Unwind Segue, you'll need the code below in the first controller. You'll use the segueToMe to connect to the Exit in the second controller. Give that Unwind segue the identifier e.g. "returnToMainViewController".
Here is the code updated to Swift 4.2
This goes in a separate UIStoryboardSegueExtensions swift file
import UIKit
class UIStoryboardSegueFromRight: UIStoryboardSegue {
}
class UIStoryboardUnwindSegueFromRight: UIStoryboardSegue {
}
And this is the revised code for your source view controller
override func segueForUnwinding(to toViewController: UIViewController, from fromViewController: UIViewController, identifier: String?) -> UIStoryboardSegue {
Tested and works