Post

Replies

Boosts

Views

Activity

Reply to SwiftData ModelContext Fetch Crashing
It seems to crash with any SwiftData related id, but it's fine when just using the primitive values let id = model.persistentModelID let descriptor = FetchDescriptor<cache>( predicate: #Predicate { $0.cacheOf.persistentModelID == id } // predicate: #Predicate { $0.cacheOf.id == id } or this ) let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here! .first) return result
Topic: App & System Services SubTopic: iCloud Tags:
Sep ’24
Reply to SwiftData ModelContext Fetch Crashing
It seems to crash with any SwiftData related id, but it's fine when just using the primitive values let id = model.persistentModelID let descriptor = FetchDescriptor<cache>( predicate: #Predicate { $0.cacheOf.persistentModelID == id } // predicate: #Predicate { $0.cacheOf.id == id } or this ) let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here! .first) return result
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Detect foreground/background change
@Environment(\.scenePhase) private var phase Does this API needs some special requirement? no changes ever comes from this. The SwiftUI view sits in a UIHostingViewController. None of the events are coming through.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’24