O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Passing data between view controllers

The final frontier for the HelloContacts app is to display some actual information about a selected contact. In order to do this, we'll need to add some new outlets to the ContactDetailViewController. The data that's loaded for contacts also needs to be expanded a little bit so a contact's phone number, e-mail address, and postal address are fetched. Finally, the contact data needs to be passed from the overview to the detail page so the detail page is able to actually display the data. The steps we'll take are as follows:

  1. Updating the data loading and model.
  2. Passing the model to the detail page.
  3. Implementing new outlets and display data.

Updating the data loading and model

Currently, the code in ViewController.swift ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required