0

So I have a situation where I have developed an iPhone application, that can be run on the iPad on the 4S resolution (the default way apple handles running iPhone app on the iPad). But now, I want to understand user activity for the user's that are using the app on the iPad, to see if it makes sense for me to build an iPad Version of the app. But, when I log UIDevice.current.userInterfaceIdiom it always returns iphone. One solution I had thought of, was to check the screen resolution (since no one uses the 4/4S anyway now), but with launch of the iPad Pro, apple runs iPhone apps on the iPad Pro using the iPhone 7 resolution. In that case, I have no way to know if the user is running the app on the iPhone or iPad.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Raunak Joneja
  • 540
  • 1
  • 3
  • 13

1 Answers1

0

I use this

+(BOOL) isIPad
{
    BOOL isPad;
    NSRange range = [[[UIDevice currentDevice] model] rangeOfString:@"iPad"];

    if(range.location==NSNotFound)
    {
        isPad=NO;


    }
    else {
        isPad=YES;
    }

    return isPad;
}
Sanniv
  • 1,892
  • 1
  • 17
  • 21