UIScreen.main.bounds.width and UIScreen.main.bounds.height are both wrong. It’s returning 414×736 but it should be about 360×640.
Device: iPhone 8 Plus.
UIScreen.main.bounds.width and UIScreen.main.bounds.height are both wrong. It’s returning 414×736 but it should be about 360×640.
Device: iPhone 8 Plus.
2
Answers
It depends on when you call the function.
You have to call this after View Appear fully.
You will get different value if you call the function on viewWillAppear.
iPhone
[Any]
Plus native rendering resolutions are downsampled by ÷1.15 because screens didn’t have enough pixels to show @3x until iPhone X arrived.Screen resolution is 360×640 physical points but screen rendering is 414×736 software points. That only happens on
Plus
models.Check out this: https://www.paintcodeapp.com/news/iphone-6-screens-demystified