Search code examples
iosipad

cannot get high resolution from ipad


I am trying to set the screen resolution of a project to 2048x1536 (retina display on ipad).

I created a new single page app in Xcode using Swift, targeted ipad, set deployment target to various values (from 8 to 11), clicked Requires full screen, and chose only landscape modes.

I changed everywhere I could find in the storyboard, but no matter what I do, it is returning 1024x768. when I to an NSLog print from the ViewDidLoad function.

Can someone possibly shed some light on how to use the ipad to its best resolution?

Jerry


Solution

  • In Xcode the size of elements and the screen are measured in points. Each device has a scale factor that is applied to the points which means developers don't have to target specific screen sizes that have the same ratios.

    Apple explain it a bit here: https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html#//apple_ref/doc/uid/TP40010156-CH14-SW7

    Graphical representation here too: https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions