I've just restarted work on a project I last worked on 4 years ago. Back then, I was using Xcode 3.2 and an iPad 2. Now I am on Xcode 8.1 and an iPad Air 2.
I can build and run the project just fine with Xcode 8.1 but there is something strange going on when getting the screen size using
CGRect rect = [[UIScreen mainScreen] bounds];
It returns 768x1024 pixels on my iPad Air 2 which can't be true because the iPad Air 2's native resolution is 1536x2048. 768x1024 is the resolution of the iPad 2, my old device.
Furthermore, not only does bounds
return the wrong dimensions, I can also clearly see that the graphics I draw to my view have been upscaled.
So my assumption is that my project is running in some sort of legacy/compatibility mode that tries to make the app believe it is still running on an iPad 2 in a resolution of 768x1024 instead of a resolution twice as big. Could that be the case or what is the explanation for this phenomenon?
So how can I get this to work correctly? i.e. how can I get bounds
to return 1536x2048 and stop automatic upscaling? I have already looked through the various options in Xcode but I don't see anything that could explain the behaviour I'm seeing here. My deployment target is set to iOS 10.1 so I don't really see why my app is put in this strange legacy mode or whatever it is...