Embedded Scenes

One thing storyboards tend to reinforce is that a single view controller is responsible for one screen-full of content. After all, there is a one-to-one correspondence of scenes to view controllers, and the scenes themselves are shaped like iPhone or iPad screens, depending on what device you’ve set the “View As” control at the bottom of Interface Builder to show.

This leads to the problem of the “Massive View Controller”. If there’s a lot going on in one scene, the natural place for all the code to deal with that is in the view controller. And when that view controller is responsible for handling UI events, populating table or collection views, dealing with rotation or remote-control media events, etc., it quickly leads to the ...

Get Xcode Treasures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.