spmno
spmno

Reputation: 845

How to Identify the new iPad

I need to know current device is iPad2 or new iPad. I use [[UIScreen mainScreen] Scale],but the result is 1.0

Upvotes: 2

Views: 535

Answers (1)

BluesRockAddict
BluesRockAddict

Reputation: 15683

As found here:

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && [[UIScreen mainScreen]     respondsToSelector:@selector(scale)] && [UIScreen mainScreen].scale > 1)
{
    // new iPad
}

Upvotes: 5

Related Questions