View Controller Subclasses and Templates

In this exercise, you were asked to create a UIViewController subclass by using the NSObject template and an empty XIB file that you configured for the view controller. This is useful for learning how the XIB file works. However, in practice, you typically let Xcode do the grunt work and use the UIViewController subclass template.

Throughout the rest of this book, you will create a lot of view controllers. To save on time and potential errors, we will instruct you to use the UIViewController template when that view controller will have a XIB file. When you create a view controller subclass with a XIB template, the XIB’s File's Owner is already set to the class of that view controller. It also has an instance ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition 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.