Cannot find VStack in scope error

Hi! I'm very, very new to Swift and SwiftUI and have been getting an error when I try to use VStack. It says "Cannot find VStack in scope" even though I believe it is in scope. Also, it is only the first Vstack that is throwing the error.

Any idea what the issue is?


struct ContentView: View {
    var body: some View {
        Vstack(spacing: 40) {
            VStack(spacing: 20) {
                Text("Cosmostory")
                    .gameTitle()
                
                Text("A fun trivia game using our course themes!")
                    .foregroundColor(Color("Accent Color"))
            }
            
            PrimaryButton(text: "Let's go!")
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .padding()
        .edgesIgnoringSafeArea(.all)
        .background(Color(red: 0.98, green: 0.929, blue: 0.847))
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

My import statement didn't paste correctly but I made sure to import SwiftUI correctly.

One of your VStacks is spelt "Vstack" instead of "VStack".

There is another issue: PrimaryButton not found

            PrimaryButton(text: "Let's go!")

Where did you define it ?

primaryButton (with lowercase) can be used in Alerts, as an argument to the Alert:

            Alert(
                title: Text("Are you sure you want to delete this?"),
                message: Text("There is no undo"),
                primaryButton: .destructive(Text("Delete")) {
                    print("Deleting...")
                },
                secondaryButton: .cancel()
            )

In your case, you should just use Button, but give it an action to execute, using one of the following syntaxes:

            Button(action: {
                print("Here we go")
            }) {
                Text("Let's go!")
            }

            Button("Let's go again!") {
                print("Here we went")
            }
Cannot find VStack in scope error
 
 
Q