Search code examples
iosswiftuistoryboarduistoryboardseguestoryboard-reference

Perform Segue to another storyboard swift


Hey I am performing a basic segue from a ViewController in one storyboard to another ViewController second storyboard.

1st storyboard : Main

2nd Storyboard : Settings

I have a reference to settings.storyboard in Main.storyboard. below are the screen shot of my setup

Storyboard Ref to Settings in Main

enter image description here

My segue(attributes) to storyboard ref. I am using a custom segue, that slides from right to left :

enter image description here

Destination VC in settings storyboard.

enter image description here

My source VC is a navigation embedded-TableViewController, I perform following operation to segue there:

let storyboard = UIStoryboard(name: "Settings", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "editprofile") as? EditProfile
performSegue(withIdentifier: "settings", sender: nil)

With the above setting I am still unable to segue to my Destination VC. I have serach stackoverflow alot and even implemented exactly, but am out of Luck. I just dont know where exactly I am going wrong.

Thanks!


Solution

  • The (withIdentifier: "editprofile") portion of your code seems wrong.

    In the images you showed, nothing has the identifier of "editprofile". I would change that to "Settings", as it seems like that is your segue's identifier.