Start a Project

How To Create Segues Between Different Storyboards in iOS

How To Create Segues Between Different Storyboards in iOS

In this blog, I am discussing how we can create segues between multiple storyboards in the same Xcode project using storyboard references.

As we know, if we want to navigate from one view controller to another between different Storyboards, it requires to code programmatically.

The drawback of using Single Storyboards is that it becomes complex to manage large projects.

Storyboard References are very helpful when you decide you decide to divide your views between storyboards.

Please follow the below steps to use Storyboard References

Step 1: Create a new Single View Application project.

Step 2: There will be main.storyboard present by default. Now, create a new storyboard file.

Step 3: Now, create a new view controller inside the new storyboard.

Step 4: On main.storyboard click on (+) Library and search for Storyboard Reference.

Step 5: Drag and Drop the  Storyboard Reference into the Main.StoryBoard .

Now, in the attributes inspector, select the new. Storyboard from the Storyboard dropdown and set the Reference ID as the Storyboard ID of the NewViewController in new.StoryBoard.

Now, we can create a segue from FirstViewController to this Storyboard reference for new.Storyboard and this will work as a normal segue.

Please follow the above step and if you have any issues or suggestions you can leave your query/suggestion in the comment section I will try to solve them.

Exit mobile version