Initial support for list views

Start by returning the simulator to portrait mode and then head on over to ContentView.swift. We want to add the following modifier to our NavigationView:


Setting navigationViewStyle to StackNavigationViewStyle() will tell our app to support ContentView by a view stack that only shows a single top view at a time, according to Apple's official SDK documentation.

Go ahead and rerun the simulator. You should see things start to look a little more as we would expect now:

With that change made, let's see how the rest of our app runs. Go ahead and click on a recipe ...

Get Learn SwiftUI now with the O’Reilly learning platform.

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