Post

Replies

Boosts

Views

Activity

Reply to Using Core Data with SwiftUI App Protocol
@andrewbuilder's answer is excellent. The only thing that needs to be changed is making "persistentContainer" a let instead of a lazy var. As as lazy var, the persistent container will not load in time for the first view. This caused a crash when my first view was trying to access my core data persistent container. However by making it a constant variable, this issue went away.
Jul ’20