home.social

#sendable — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sendable, aggregated by home.social.

  1. One day I need to learn wtf this @ sendable stuff is that Xcode whines about nowadays. It seems to be something that should be simple that has gone through a concurrent swiftification and instantly become hard to understand and impossible to implement correctly. Everything about concurrency in Swift feels unnecessarily complicated and cursed. Or maybe I’m just too dumb for for this? Very plausible.

    #swift #concurrency #sendable

  2. #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.

  3. #Swift #Concurrency #Sendable

    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”

    🤔

  4. #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?