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.
Asked
Active
Viewed 140 times
0

rmaddy
- 314,917
- 42
- 532
- 579

Raunak Joneja
- 540
- 1
- 3
- 13
-
1If you only care about whether the device is an iPad or iPhone, why not use `UIDevice.current.model`? – Dávid Pásztor Aug 17 '17 at 10:27
-
you are talking about iPad or iPod? – Ronak Chaniyara Aug 17 '17 at 10:51
-
1here is your answer [StackOVerFlow Answer](https://stackoverflow.com/a/26962452/5259363) – Abdul Waheed Aug 17 '17 at 11:50
1 Answers
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