Hooking Up the Content

To display the information for the selected Item, you will need to create a new UIViewController subclass.

Create a new Swift file and name it DetailViewController. Open DetailViewController.swift and declare a new UIViewController subclass named DetailViewController.

import Foundation
import UIKit

class DetailViewController: UIViewController {

}

Because you need to be able to access the subviews you created during runtime, DetailViewController needs outlets for them. The plan is to add four new outlets to DetailViewController and then make the connections. In previous exercises, you did this in two distinct steps: First, you added the outlets in the Swift file, then you made connections in the storyboard ...

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