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

Use UIApplication and view.windowScene.screen instead of UIScreen.main on iOS 13.0 and later (#804) #805

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hyun99999
Copy link

@hyun99999 hyun99999 commented Oct 18, 2023

UIScree.main will be deprecated in a future version of iOS.
I used Use UIApplication and view.windowScene.screen to get display's scale.

developer doc > mian already deprecated. It causes serious errors in the near future.

So have to change another way. And UIApplication and view.windowScene.screen is the others way of getting display's scale. That is available from iOS 13.0. This is why control flow has iOS 13.0 condition.

Resolved: #804

@hyun99999 hyun99999 changed the title Use UIApplication instead of UIScreen.main on iOS 13.0 and later Use UIApplication instead of UIScreen.main on iOS 13.0 and later (#804) Oct 18, 2023
@hyun99999 hyun99999 changed the title Use UIApplication instead of UIScreen.main on iOS 13.0 and later (#804) Use UIApplication and view.windowScene.screen instead of UIScreen.main on iOS 13.0 and later (#804) Oct 18, 2023
@NikKovIos
Copy link
Collaborator

I suggest to write one place (extension or struct) where would be calculation height or width or bounds and use it. Not to write everywhere if #available(iOS 13.0, *)

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

Successfully merging this pull request may close these issues.

UIScreen.main will be deprecated in a future version of iOS
2 participants