Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad Pro device detection

Tags:

I am trying to detect iPad Pro device , trying to guess its height with :

NSLog(@"%f",self.view.frame.size.height); 

But it returns 1024 ! same as iPad non retina devices . any advice ?

I need to specify some codes exact for iPad Pro with this line of code :

#define iPadPro ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [UIScreen mainScreen].bounds.size.height == 2732) 

...and the codes must detect iPad Pro even on iOS simulator !

Thanks

EDITED : Some suggest use LunchScreen , but when I use it this happens (scaled down) : enter image description here

like image 691
iOS.Lover Avatar asked Oct 31 '15 15:10

iOS.Lover


People also ask

What is people detection on iPad Pro?

On iPad Pro 11-inch (2nd generation and later) and iPad Pro 12.9-inch (4th generation and later), you can use the Magnifier app to detect people and help you maintain a physical or social distance from others. When iPad detects people nearby, you're notified with sounds or speech.

Where is Device Management on iPad Pro?

You can see the profiles you have installed in Settings > General > Profiles & Device Management. If you delete a profile, all of the settings, apps, and data associated with the profile are also deleted.

How do I find out what devices are on my iPad?

Look on the back of your iPad. Open Settings, tap General, then tap About. Look for the model number in the top section.

Does iPad have a tracking device?

Use the Find My app to locate and play a sound on a missing iPhone, iPad, iPod touch, Mac, Apple Watch, AirPods, or Beats headphones (supported models). In order to locate a device, you must turn on Find My [device] before it's lost.


2 Answers

Special thanks to @rmaddy

The proper way to detect screens sizes is :

NSLog(@"%f",[UIScreen mainScreen].bounds.size.height); 

Now if your application runs in Portrait mode you can simply use this code to detect iPad Pro :

#define iPadPro ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [UIScreen mainScreen].bounds.size.height == 1366) 

Don't forget the need to use a LaunchScreen or the app won't take advantage of the iPad Pro's larger screen

like image 70
iOS.Lover Avatar answered Nov 01 '22 18:11

iOS.Lover


detect iPad pro 12.9 inch no matter device's orientation

#define iPadPro12 (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad && UIScreen.mainScreen.nativeBounds.size.height == 2732)  
like image 31
Homam Avatar answered Nov 01 '22 17:11

Homam