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

More robust isZoomed check #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

allewun
Copy link

@allewun allewun commented Nov 28, 2017

On iPhone X in compatibility mode, iOS reports UIScreen.main.bounds.size as 375x667 (which means iPhone X in compatibility mode is effectively a 4.7" device).

However, when calling SDiOSVersion.deviceSize(), the isZoomed check improperly returns true, so instead of getting .Screen4Dot7inch, I get .Screen5Dot5inch.

If someone could help verify this logic is correct (or at least more correct than the current one), I'd really appreciate it!


A couple scenarios I collected:

iPhone 6 (unzoomed):

  • nativeScale: 2.0
  • scale: 2.0

iPhone 7 Plus (unzoomed):

  • nativeScale: 3.0
  • scale: 3.0

iPhone X (unzoomed):

  • nativeScale: 3.0
  • scale: 3.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.

1 participant