I'm trying to convert s String
property of a Sendable
structure to LocalizedStringResource
, so that Xcode extracts it into the string catalog. There is a warning since LocalizedStringResource
is not Sendable
currently.
Should LocalizedStringResource be Sendable?
Hi,
It’s not Sendable
because it contains a String.LocalizationValue
which can contain arbitrary arguments.
They can really be anything and there’s no way we can guarantee all of them to be Sendable
.
So it is not safe to pass LocalizedStringResource
across isolation domains.
LocalizedStringKey
is Sendable
. How do the two differ? The documentation of LocalizedStringResource
says: A reference to a localizable string, accessible from another process. Does it mean it's Sendable
?