#WWDC23 #CloudKit #Concurrency #Sendable #Swift #Canopy
In this year’s platform release, many CloudKit types, most importantly CKRecord, are now Sendable 🎉
Nice to see in the docs, and confirmed in an Ask Apple session.
I built Canopy with Xcode 15 and was wondering where all the actor boundary crossing warnings had gone.
I still got work to make Canopy completely warning-free, but this is great.
#wwdc23 #cloudkit #concurrency #sendable #swift #canopy
Wasn’t it the story that Xcode betas have a lot of Sendable warnings which get removed in the final version?
Xcode 14.3 RC is out now, and it still shows me a ton of warnings like:
“Non-sendable type 'XYZ' returned by actor-isolated instance method 'whatever' satisfying protocol requirement cannot cross actor boundary”
“Non-sendable type 'XYZ' in parameter of actor-isolated instance method 'abc' satisfying protocol requirement cannot cross actor boundary”
🤔
#Swift #actor #concurrency #Sendable
So how DO you work with Swift actors, protocols, and non-sendable types? Consider the code shown. In Xcode 14.3 beta, it has this warning, which I assume will turn into error at some later point.
NSItemProvider here is just an example of any non-Sendable type.
How do I properly cross actor boundaries with non-Sendable but immutable types?
#swift #actor #concurrency #sendable