devicekit / DeviceKit

DeviceKit is a value-type replacement of UIDevice.
MIT License
4.42k stars 428 forks source link

isZoomed wrong value for iPhone X #265

Open Tulleb opened 3 years ago

Tulleb commented 3 years ago

From the console, when doing it on a real iPhone X device having Display Zoomed enabled (iOS 14+):

(lldb) po DeviceKit.Device.current.isZoomed
▿ Optional<Bool>
  - some : false
chrisvasselli commented 2 years ago

It looks like it's treating all devices with a scale of 3 as if they are doing the scaling trick that the "plus" devices do. I think isZoomed is probably wrong for a lot of modern devices.

I don't see any property exposed currently that distinguishes the devices doing this scaling trick, seems like something worth adding? At first glance I don't see an obvious way to determine this from scale and nativeScale, given that those values will change based on zoom mode. So maybe we need to maintain a new set of devices, allNonNativeScaleDevices or something?

ricsantos commented 1 year ago

Just doing some testing now and can confirm iPhone 13 Pro Max is returning false for isZoomed even though it is zoomed (in Simulator).

(lldb) po UIScreen.main.nativeScale
3.424

(lldb) po UIScreen.main.scale
3.0
joostfunkekupper commented 1 year ago

I'm having similar issues. My device is an iPhone 11 Pro running iOS 16.1, and it is returning false when in fact have Display Zoomed set to Large text.

Scale 3.000000
Native scale 3.515625
mrjlovetian commented 11 months ago

i'm have same issues. device is iPhone x, os is 15.6. device is zoom mode, but isZoomed return false.