Adding the Cancel and Done buttons to the navigation bar

One of the benefits of embedding a view controller in a navigation controller is the navigation bar at the top of the screen. You can place buttons on its left- and right-hand sides.

Follow these steps to add the Cancel and Done buttons to the navigation bar:

  1. Click the Navigation Item in the View Controller Scene. Then, click the Object library button:
  1. Type bar b into the filter field and drag two Bar Button Item objects to each side of the navigation bar:

  1. Click the Item button on ...

Get iOS 13 Programming for Beginners - Fourth 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.