Showing the detail view

When the user taps a cell, the detail view should be shown on the screen with the information of the corresponding to-do item. The selection of the cell is managed by the data provider because it is the delegate for the table view. The presentation of the detail view controller is managed by the item list view controller. This means the data provider has to communicate the selection of a cell to the list view controller. There are several different ways to achieve this. We will use a notification because it will be interesting to take a look at how we can test sending of notifications.

Communication with notifications has two partners: the sender and the receiver. In our case, the sender is the data provider. Let's ...

Get Test-Driven iOS Development with Swift 4 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.