iPhone XR screen resolution according to screenshots, apple website and etc.:
828x1792
iPhone XR screen resolution according to Swift:
375x812 (or 750x1624)
Why and how to deal with it?!
NOTE: all iphones Xx work properly except of this one - iphone XR (+iphone XR simulator)
You are getting the iphone X resolution, and that happens most probably because you are using the iphone X in storyboard. The code gives you the storyboard resolution first. If you want to get the real size, call layoutIfNeeded() method before the code that uses the resolution