PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
29 stars 37 forks source link

Initializing PostHog in a SwiftUI app results in accent color not being respected #53

Closed pixlwave closed 1 year ago

pixlwave commented 1 year ago

Similar to https://github.com/getsentry/sentry-cocoa/issues/2741, there is an issue when using PostHog in a SwiftUI app. Steps to reproduce:

The fix is the same as Sentry implemented and stop using the now deprecated UIScreen.main. The simplest solution if there isn't access to an actual view is to do this via UIApplication's windows property.