Post

Replies

Boosts

Views

Activity

Reply to Swift Playgrounds .environmentObject error CreatureZoo()
You have to create the environment object at the top level of your hierarchy and inject it into your topmost view using .environmentObject(yourEnvironmentObject), where yourEnvironmentObject ist the object you created. See the following article: https://www.hackingwithswift.com/quick-start/swiftui/how-to-use-environmentobject-to-share-data-between-views
Jul ’22