Skip to content

Commit

Permalink
chore: silence shared warning for strict concurrency (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Apr 16, 2024
1 parent 50d65d9 commit b5a458d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- chore: silence `shared` warning for strict concurrency [#129](https://github.com/PostHog/posthog-ios/pull/129)

## 3.3.0-alpha.1 - 2024-03-27

- iOS session recording - very first alpha release [#115](https://github.com/PostHog/posthog-ios/pull/115)
Expand Down
16 changes: 12 additions & 4 deletions PostHog/PostHogSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
private var replayIntegration: PostHogReplayIntegration?
#endif

@objc public static let shared: PostHogSDK = {
let instance = PostHogSDK(PostHogConfig(apiKey: ""))
return instance
}()
// nonisolated(unsafe) is introduced in Swift 5.10
#if swift(>=5.10)
@objc public nonisolated(unsafe) static let shared: PostHogSDK = {
let instance = PostHogSDK(PostHogConfig(apiKey: ""))
return instance
}()
#else
@objc public static let shared: PostHogSDK = {
let instance = PostHogSDK(PostHogConfig(apiKey: ""))
return instance
}()
#endif

deinit {
#if !os(watchOS)
Expand Down

0 comments on commit b5a458d

Please sign in to comment.