In my app, I have an NSPersistentCloudKitContainer set up in the following way:
let container: NSPersistentCloudKitContainer
init() {
self.container = NSPersistentCloudKitContainer(name: "Model")
self.container.persistentStoreDescriptions[0].setOption(
true as NSNumber,
forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey
}
self.container.loadPersistentStores { (_, error) in
guard error == nil else {
print("error loading store: \(error.debugDescription)")
return
}
}
self.container.viewContext.automaticallyMergesChangesFromParent = true
}
When I invoke a fetch request on the context of the container in my iOS target, it works as expected. However, when I perform the same fetch request in my Widget target, it returns an empty array result.
In my iOS target, I have Background Modes / Remote Notifications and iCloud / CloudKit capabilities. In my Widget target, I have the iCloud / CloudKit capability.
Not sure why it isn't working, so any help would be much appreciated, thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When embedding a Text(_:style:) View in a ScrollView, SwiftUI produces the following error:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
A minimal example is this:
struct ContentView: View {
		var body: some View {
				ScrollView { Text(.init() + 60, style: .relative) }
		}
}