Post

Replies

Boosts

Views

Activity

Reply to SwiftData - Context missing for optional
Hello all, I'm facing the same issue - works fine on iOS 17. Crash on iOS 18 beta 5 (iOS and Xcode). Happens on device and simulator (tested on these platforms - iPhone, iPad, watchOS) I have the following SwiftData structure. CloudKit configuration - Room Session ModelContext activity is handled on SwiftUI view (create model, insert, save) Room has cascade array of Session. Initial state: No sessions. Create new session and append it to room's sessions. Delete the session. I check the state now - room is exist with empty sessions, as expected Create a new one. Crash on - _$observationRegistrar.access(self, keyPath: \.room) return self.getValue(forKey: \.room) } I print the PersistentIdentifier before the crash and everything seems to be ok - PersistentIdentifier(id: CoreData: debug: CoreData+CloudKit: -[NSCloudKitMirroringDelegate managedObjectContextSaved:]: <NSCloudKitMirroringDelegate: 0x303ab00f0>: Observed context save: <NSPersistentStoreCoordinator: 0x302ea1ce0> - <NSManagedObjectContext: 0x303ea5110> SwiftData.PersistentIdentifier.ID(url: x-coredata://ED065B2F-2704-46AD-88E1-4F1BE2BA7098/Session/p44), implementation: CoreData: CloudKit: CoreData+CloudKit: -[PFCloudKitExporter analyzeHistoryInStore:withManagedObjectContext:error:]: <PFCloudKitExporter: 0x302598370>: Exporting changes since (0): <NSPersistentHistoryToken - { SwiftData.PersistentIdentifierImplementation) SwiftData.PersistentModel.persistentModelID.getter : SwiftData.PersistentIdentifier PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://ED065B2F-2704-46AD-88E1-4F1BE2BA7098/Room/p8), implementation: SwiftData.PersistentIdentifierImplementation) PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://ED065B2F-2704-46AD-88E1-4F1BE2BA7098/Room/p8), implementation: SwiftData.PersistentIdentifierImplementation) After the crash I open my app again, the session appears and everything works as expected. Hope this helps. Thanks a lot, Dudi
Aug ’24
Reply to RealityKit gesture doesn't work on child entity
Hey @gchiste Thank you so much! I really tried all the options, but I'm always happy to learn :-) I have a big surface (rectangle) with small bricks attached to it. I tried to add the collision and the input target components only to the bricks and it didn't help. I only need the surface to function as a board with the bricks attached to it - I don't need any gesture to be detected on the surface. So as for now, even if the surface is configured with or without the components, the gesture is not detected by the child. Is it possible to achieve this functionality? What should be the structure of the entities and the components? I expect that this structure will work - Surface - no components Bricks - collision and input target components But it doesn't.
Mar ’24
Reply to RealityKit gesture doesn't work on child entity
Hey @gchiste, The problem is that the gesture is not recognized by the child entity. I have a surface and some child entities and when I try to capture the gesture on one of the Childs, it's detected only by the part child (the surface). If you check the tapped entity you will see that it's the parent and not the child, so you can't actually get any details from the child entity. If you have one parent and 5 childs, you'll always get the value of the parent entity, regardless the child you actually tapped.
Mar ’24