amplitude / Amplitude-Swift

Native iOS/tvOS/macOS/watchOS SDK
MIT License
26 stars 20 forks source link

Add Support for Swift Concurrency #201

Open Mackarous opened 1 month ago

Mackarous commented 1 month ago

Summary

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

@preconcurrency import 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.

crleona commented 1 month ago

Hi @Mackarous - this is planned but we do not yet have an ETA.

tareksabry1337 commented 3 weeks ago

@crleona Xcode 16 is around the corner, any plans to get this done?