How to check if the iPad mini device

Possible duplicate:
Working with the Mini Mini Screen Size

Is it possible to detect that your iOS application is running on iPad mini at runtime?

iPad mini has the same resolution as iPad 1(2) ( 1024x768 ).

But the iPad mini has 7,9 inches and the iPad 1(2) - 9,7 inches.

So the question is how to check if the device is an iPad mini.

+7
source share
2 answers

This answer provides a link to a useful method to get a "platform string" that can be used to identify various iOS devices. I copy the main method here for your convenience:

 #include <sys/types.h> #include <sys/sysctl.h> - (NSString *) platform { size_t size; sysctlbyname("hw.machine", NULL, &size, NULL, 0); char *machine = malloc(size); sysctlbyname("hw.machine", machine, &size, NULL, 0); NSString *platform = [NSString stringWithUTF8String:machine]; free(machine); return platform; } 

According to the Model - Wiki for iPhone , the return value of platform is one of

  • iPad2.5
  • iPad2.6
  • iPad2.7

for iPad mini.

+14
source

Apple, apparently, does not have to know about it. :( Your application behaves in every way in exactly the same way on the iPad 1 or 2 screen and iPad mini-screen. As for the pixels, they are the same size.

And any other aspect of the device, such as its hardware capabilities (for example, does it have a camera?), Can be checked in the usual way using the appropriate API for using this equipment.

+1
source

All Articles