Tim
Tim

Reputation: 737

is @ObservedObject supported in xcode 12 in a MacOs app?

Error in macos swiftui xcode 12 app

Is @ObservedObject supported in xcode 12 in a MacOs app? If not, any other way to do this? This is my first macos app...Thanks!

Upvotes: 1

Views: 21

Answers (1)

Asperi
Asperi

Reputation: 257789

Move it out of the body, ie.

struct ContentView: View {
    @ObservedObject var net = Webservice()   // << here !!

    var body: some View {
    ...
    }
}

Upvotes: 1

Related Questions