You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if using the SDK in a project that enables strict concurrency checking, Xcode will complain that the Amplitude object is not marked as Sendable and is not concurrency safe.
To circumvent these warnings (which may become errors in Swift 6), we can mark the library as @preconcurrency
@preconcurrencyimport AmplitudeSwift
Motivations
Swift Concurrency is becoming a large part of the Swift language, and moving into 6.0 will be important to add support. This might mean exposing a different kind of object, or migrating the Amplitude class itself to an actor.
The text was updated successfully, but these errors were encountered:
@klioop I looked into originally trying to support this when I needed it last year.
There's no way they'll end up doing this. It would require a thorough understanding of Swift Concurrency throughout the codebase and almost an entire rewrite of how things are architected at the moment as they utilize a lot of APIs that Apple has marked as @MainActor isolated, as well as a ton of singletons all over the place.
You are better off just using @preconcurrency import
Summary
Currently, if using the SDK in a project that enables strict concurrency checking, Xcode will complain that the
Amplitude
object is not marked asSendable
and is not concurrency safe.To circumvent these warnings (which may become errors in Swift 6), we can mark the library as
@preconcurrency
Motivations
Swift Concurrency is becoming a large part of the Swift language, and moving into 6.0 will be important to add support. This might mean exposing a different kind of object, or migrating the
Amplitude
class itself to an actor.The text was updated successfully, but these errors were encountered: