Jaanus Kase · @jaanus
328 followers · 534 posts · Server mastodon.justtact.com

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

Last updated 1 year ago

Jaanus Kase · @jaanus
292 followers · 375 posts · Server mastodon.justtact.com

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 #concurrency #sendable

Last updated 2 years ago

Jaanus Kase · @jaanus
278 followers · 272 posts · Server mastodon.justtact.com

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

Last updated 2 years ago