diff --git a/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift b/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift index d42b2c4..23231e0 100644 --- a/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift +++ b/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift @@ -37,8 +37,8 @@ public extension NSManagedObjectModel { // MARK: - Cached ManagedObjectModels private let lock = NSLock() -private var map = [ Set : NSManagedObjectModel ]() -private let sharedBuilder = SchemaBuilder() +nonisolated(unsafe) private var map = [ Set : NSManagedObjectModel ]() +nonisolated(unsafe) private let sharedBuilder = SchemaBuilder() public extension NSManagedObjectModel { diff --git a/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift b/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift index c8e5a89..9ff8195 100644 --- a/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift +++ b/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift @@ -113,7 +113,7 @@ public extension Scene { // MARK: - Primitive // Note: The docs say that a container is only ever created once! So cache it. -private var modelToContainer = [ ObjectIdentifier: NSPersistentContainer ]() +nonisolated(unsafe) private var modelToContainer = [ ObjectIdentifier: NSPersistentContainer ]() private func makeModelContainer( for modelTypes : [ any PersistentModel.Type ],