I'm creating a unwind segue using storyboard, following the instruction here.
But what I want to do is to create that unwind segue programmatically using swift,
The reason behind this is I want to create a default unwind segue to all of my UIViewController.
If you mean to go back to the root view controller you can use
popToRootViewControllerAnimatedonnavigationControllerlike this:Or if you wish to pop back to a particular view controller then use: