Check is iphone or ipad

I know this question has been ask before and one way of doing this is checking of iphone generation as such:

// Check is Ipad
if( iPhone.generation == iPhoneGeneration.iPadUnknown ||
	iPhone.generation == iPhoneGeneration.iPad1Gen  ||
	iPhone.generation == iPhoneGeneration.iPad2Gen  ||
	iPhone.generation == iPhoneGeneration.iPad3Gen  ||
	iPhone.generation == iPhoneGeneration.iPad4Gen  ||
	iPhone.generation == iPhoneGeneration.iPadMini1Gen)
	// bla bla

However, as years goes by you have to continuously add in the type of ipad device in the list and when you have plenty of old apps to updates.

My question would be is there simpler solution just to tell this is an ipad?

Thanks for the answer guys. I found something like this:

if((iPhone.generation.ToString()).IndexOf("iPad") > -1){
  //bla bla

Tested, I believe this would work.

Update for Unity 5:


Use Screen.dpi along with the screen resolution, which will enable you to get the physical size of the screen. You can assume anything smaller than 7 inches is a phone.

I’ve been using a 6" threshold for the screen diagonal as a phone/tablet differentiator applied when

SystemInfo.deviceType == DeviceType.Handheld.

You can calculate the length of the screen diagonal in inches by using Screen.width, Screen.height, Screen.dpi and the Pythagorean Theorem.

Now there are these things called “fablets”, so you may want to adjust the threshold depending on whether you want “fablets” to be classified as phones or tablets.