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:

.navigationViewStyle(StackNavigationViewStyle())

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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.