In programming, the term refactor means to take your existing code and improve on it without changing its behavior. We can apply refactoring to storyboards. We are going to refactor our storyboard so that each View Controller in our app has its own storyboard file. First we are going to separate by tabs (Map
and Explore
).
We will be using what is called storyboard reference, which is to add references between story-boards. A storyboard reference in one storyboard can point to an area in a different storyboard. This gives us a way to organize our storyboards, rather than having one massive storyboard with which to work. Open your Main.storyboard
file.
- With the scenes selected, navigate to
Editor
|Refactor to Storyboard
. - You are prompted to name the storyboard. Name this
Map.storyboard
and then hitSave
.
- Once you hit save, you are now inside...