ContentView error

I'm having issues in Xcode with the ContentView. The error says "cannot find ContentView in Scope". How do I fix that?

Answered by Claude31 in 708046022

You should have in your code somewhere, something like this:

struct ContentView: View {

    var body: some View {
        Text("Hello, World!")
    }
}

wrong image. heres the correct image

Accepted Answer

You should have in your code somewhere, something like this:

struct ContentView: View {

    var body: some View {
        Text("Hello, World!")
    }
}

Just make sure it has a target selected under target membership:

ContentView error
 
 
Q