Duaan Duaan - 1 year ago 124
iOS Question

How to distinguish between iPhone and iPhone (Retina 3.5 inch) Programmatically?

Its easy to check whether device is iPhone 5 or iPhone, by checking its height, as given below

if([UIScreen mainScreen].bounds.size.height == 568){
// iPhone 5
} else{
// Regular iPhone

However, I want to know, after coming in else body 480 height , I want to check whether its iPhone or iPhone retina?

How can do that?

My main target is to set navigation, as given in my another question



Answer Source

If you really need this, you can use something like this:

if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
    if ([[UIScreen mainScreen] scale] >= 2.0) {
        // retina
    else {
        // not retina