0

I have the following implementation:

final class Article: NSManagedObject {
    @NSManaged var title: String!
    @NSManaged var summary: String!
}

class someOtherClass {
    @ObservedObject var article: Article?
}

But I'm getting this error:

Unknown attribute 'ObservedObject'

enter image description here

My question is how can I fix this error? or any of you knows a work around.

user2924482
  • 8,380
  • 23
  • 89
  • 173

1 Answers1

0

If you want to access a class in another class you have to create a reference of it. You would only use observedobject, environmentobject, etc. in your view.

Trevor
  • 580
  • 5
  • 16