Embedding view controllers using container view
We will talk about something very simple in this section, but it has a high impact when working with storyboard and interface builder. In storyboard, you can create a container view, which acts as a holder or container for another view controller in your storyboard. You may ask why we need to do this when we can add the layout of this view controller just directly as a subview. The most benefit you can get out of this is when you have a view, which is reusable, in different locations in your app; you can create it in a different view controller and have it embedded whenever and wherever you want, without needing to duplicate any screen or any layout.
How to do it...
Let's create a new Xcode project to see this in action. Create a new project with template Page-Based Application.
Try to run the project; you will see something like this:
You will see a page view controller that displays a white subview and a month title. You can navigate between...