Adding model objects and configuring navigation
You now have a view that can be used to display the details of a restaurant. You'll use this view as a cell in a SwiftUI list, which is a container that presents data in a single column. You'll also configure model objects to populate this list. Follow these steps:
- Command + click on the
HStack
view and choose Embed in List to display a list containing five cells on the canvas: - Verify that your code looks like this:
struct ContentView: View { var body: some View { List(0 ..<5) { item in Spacer() VStack{ Text("The Tap...