Search code examples
iosswiftuinavigationcontrollersegueuistoryboard

how to perform push segue to certain view controller in navigation stack in the different storyboard?


I want to perform push segue ( so I can have back button in the top left), from main.storyboard to my another storyboard (second storyboard).

enter image description here

I want to perform push segue from the red view controller in the main.storyboard to the second (number 2) view controller in the second.storyboard

from here (main.storyboard): enter image description here

to here no.2 (second.storyboard) : enter image description here

can I do that? what should I do?


Solution

  • Create a reference id for the ViewController you want to push

    In the second storyboard

    Choose the ViewController on the interface builder

    Assign "Storyboard ID" to it (for ex. SecondVC)

    Back to the main storyboard

    choose the storyboard reference to the "second" storyboard and add the VC id (SecondVC) in the "Referenced ID" field