I second this one! There are so many app ideas for this.
Post
Replies
Boosts
Views
Activity
Any update to this? would be interested in getting a hardware dock to work with the accessory manager
Any update on this one???
@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.
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
Turns out, once I get the token from appleID. I can directly send it into subSystem A and subSystem B and it worked just fine.
Turns out, I added an share extension with a new bundle id. The new id needs manually registered :|
The xcode cloud error might or may not be related to solving my error code 70. The export and distribute is the way to debug.
swiftData is very busted on iOS 18. It broke all of my preview with swiftData. Somehow persistentModelID no longer works, too
turns out setting data on the Observable's property NEEDS to happen in a closure scheduled in to an actor. Otherwise it crashes
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
Some update on this! So turns out, I was fetching a model that was just created. The system can't find the model. I guess this was a cache miss in swiftData?!
To Fix This: In your modelActor try? self.modelContext.save()
basically, you want the modelContext to write into disk to create the persistentModelID
Good luck!