Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated: UIScreen.main #358

Open
henrikac opened this issue Jul 28, 2023 · 1 comment
Open

Deprecated: UIScreen.main #358

henrikac opened this issue Jul 28, 2023 · 1 comment

Comments

@henrikac
Copy link

I can see in the source code that this package is using UIScreen.main a lot. However, this was deprecated in iOS 16.

https://developer.apple.com/documentation/uikit/uiscreen/1617815-main

@acosmicflamingo
Copy link

acosmicflamingo commented Dec 29, 2023

I wonder how realistic it it would be to replace it with the recommended way of accessing a scene instance to get the screen:

let screen = UIApplication.shared.connectedScenes.first(
  where: { $0 is UIWindowScene }
) as? UIWindowScene

Because it's optional, I don't know of a clean replacement that is guaranteed to always return some screen object like what UIScreen.main does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants