PostHog / posthog-ios

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

Stop using UIScreen.mainScreen to fix accent color #54

Closed pixlwave closed 1 year ago

pixlwave commented 1 year ago

What does this PR do? UIScreen.mainScreen is deprecated and SwiftUI apps lose their accent colour if the screen is accessed this way before the app's body is evaluated. This PR switches to reading the screen size from the app's first window and fixes #53.

Where should the reviewer start? Test it against a sample app.

How should this be manually tested? Read the steps to reproduce the issue in #53 and test this PR against that.

Any background context you want to provide? No

What are the relevant tickets?

53

Screenshots or screencasts (if UI/UX change)

Questions:

benjackwhite commented 1 year ago

Going to check this out locally as I don't think this generally works. I believe that sharedApplication is not available in extensions which we technically currently support.

pixlwave commented 1 year ago

Ah yeah good point, didn't think about that 🤔

pixlwave commented 1 year ago

Closing in favour of #55.