Исправление предупреждений о несоответствии «Sendable» для ImageResource в Swift 5.10. ⇐ IOS
-
Anonymous
Исправление предупреждений о несоответствии «Sendable» для ImageResource в Swift 5.10.
I have a file with some constants that maps enums to associated ImageResource for simplified usage in other places. Sample is below
static let imagePreviews: [MyEnum: ImageResource] = [ .Enum1: .imageResource1, .Enum1: .imageResource2, ... ] After upgrading to latest XCode that uses Swift 5.10 following warning is shown around code block above and judging by other similar warnings, common pattern is usage of ImageResource
Static property 'activityBlockImagePreviews' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
Источник: https://stackoverflow.com/questions/781 ... swift-5-10
I have a file with some constants that maps enums to associated ImageResource for simplified usage in other places. Sample is below
static let imagePreviews: [MyEnum: ImageResource] = [ .Enum1: .imageResource1, .Enum1: .imageResource2, ... ] After upgrading to latest XCode that uses Swift 5.10 following warning is shown around code block above and judging by other similar warnings, common pattern is usage of ImageResource
Static property 'activityBlockImagePreviews' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
Источник: https://stackoverflow.com/questions/781 ... swift-5-10
Мобильная версия