Chapter 7 - NavigationView

V8.1 P251
After adding AboutView.swift to Bullseye, we started to add a navigationView to the ContentView.
Following the steps, I put in

var body: some View {
NavigationView {

}.navigationViewStyle(.stack)

however there is an error shows up
“Reference to member ‘stack’ cannot be resolved without a contextual type”
and the App can’t be built.

Then I searched the web and tried as below


everything’s going well.

But as I’m a newbie, I can’t understand how that happens.
I’m looking forward to an answer, appreciate.

@accordionguy Can you please help with this when you get a chance? Thank you - much appreciated! :]

This topic was automatically closed after 166 days. New replies are no longer allowed.