create app group to share database
fix widget layouts / calls i think widgets work
This commit is contained in:
@@ -190,12 +190,12 @@ class PersistenceController {
|
||||
item()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func setupContainer() -> NSPersistentContainer {
|
||||
if useCloudKit {
|
||||
container = NSPersistentCloudKitContainer(name: "Feels")
|
||||
} else {
|
||||
container = NSPersistentContainer(name: "Feels")
|
||||
container = NSCustomPersistentContainer(name: "Feels")
|
||||
}
|
||||
|
||||
for description in container.persistentStoreDescriptions {
|
||||
@@ -274,3 +274,12 @@ extension NSManagedObjectContext {
|
||||
NSManagedObjectContext.mergeChanges(fromRemoteContextSave: changes, into: [self])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class NSCustomPersistentContainer: NSPersistentContainer {
|
||||
override open class func defaultDirectoryURL() -> URL {
|
||||
var storeURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.88oak.ifeel")
|
||||
storeURL = storeURL?.appendingPathComponent("Feels.sqlite")
|
||||
return storeURL!
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user