Master-Detail Communication

In Chapter 14, we discussed different options for allowing view controllers to send messages to each other. Using instance variables is the simplest option, and that’s what we’ve done in Nerdfeed – we gave the ListViewController a pointer to the WebViewController. In this simple application, this approach works fine. Now let’s make Nerdfeed a little more complex and write a delegate protocol instead.

Right now, the detail view controller displays the WebViewController when a row in the master view controller is selected. In a moment, you’re going to create another view controller called ChannelViewController that will display metadata about the RSS feed. You will also create an Info button on the ListViewController ...

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.