1
votes

I have this story board and I'm trying to make custom segue to slide the View Controller to the left side and from right to present the Table view Controller. I need unwind segue to go back to the Main view controller (the one I segue from). I know that such question might be asked before but i think here the case is more specific as it's involves Table view controller. Anyone please help. Btw I'm writing in Swift.

My goal is to have segue in both directions with custom transition. Because if you chose show segue it is presenting the table viewer controller from bottom to top and not from left to right.

I asked this question where I'm using classes to handle the custom transitions but i'm getting errors unfortunately. Create Unwind segue error (lldb)

Thank You.

enter image description here

2

2 Answers

1
votes

This is actually just an unwind segue you need. UITableViewController inherits from UIViewController so it can do everything a view controller can do (and much more!). I suppose its slightly different in the way you set it up. So you need to right click from your view controller (the yellow circle at the top of the middle view controller in your image) to the edit icon (on the right hand side on the middle view controller in your image). This will allow you to select a unwind segue function to call.

If you didn't know, before doing that you need to setup your unwind segue function. Long story short, basically just add the follow to the view controller you want to unwind to.

@IBAction func unwindToThisViewController(segue: UIStoryboardSegue) {
   /// Do something here if you want to
}

Then you just call your perform segue from wherever you need it

performSegueWithIdentifier("myUnwindSegueName", sender: nil)
0
votes

Check out this tutorial for the exit(unwind segue): Segue from modal view to tab bar view controller and not lose tab bar

In regards to excecuting the segue just do this:

performSegueWithIdentifier("yourSegueIDGoesHere", sender: self)