Is it possible to detect that your iOS app is running on an iPad mini at runtime?-Collection of common programming errors
There is no reliable, future-proof way to detect the iPad mini’s pixel density. Other answers suggest looking at the hw.machine
string. But we don’t know (as of the time I write this) what the strings will be for the iPad mini cellular models (though we can make an educated guess: iPad2,6
will probably have GSM and iPad2,7
will probably have CDMA).
It’s fine to look at the hw.machine
string for analytics. But it’s dangerous to let it affect your app’s user interface, because even the iPad2,5
string for the current iPad mini is subject to change.
When the iPad 2 came out, the wifi model’s string was iPad2,1
. Later (when they released the iPad 3), they changed the iPad 2 hardware and changed the hw.machine
string to iPad2,4
, but they still called it the iPad 2. The same thing could happen with the iPad mini – or even with the iPad 2 again! For example, Apple could release yet another version of the iPad 2 hardware and give it the machine string iPad2,8
.