Chapter 11
Working with Navigation View
Just build something that you'd want to use today, not something you think people would use somehow.
– Paul Graham
First things first, what's navigation view? Like list views, navigation views are another common UI components in iOS apps. It provides a drill-down interface for hierarchical content. Take a look at the built-in Photos app, YouTube, and Contacts. They all use navigation controllers to display hierarchical content. Generally, you combine a navigation view with a stack of list views to build an elegant interface for your apps. Being that said, this doesn't mean you have to use both together. Navigation views can work with any types of views.
Creating Navigation Views
Let's head back to the FoodPin project and open the RestaurantListView.swift
file.
Hold the command key and click List
in RestaurantListView
. In the context menu, choose Embed.... Then change the default Container
to NavigationView
.

To access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.