I use the iOS Get Device for disabling features on low end devices, but what if you want to simply detect if you are on an iPad or an iPhone/iPod Touch, even for future devices.
Maybe there is another way of doing this, but this is really simple.
Step 1
Include window control object.
Detect iPad:
Run this event once
ScreenXSize(WindowControlObject)>640
Detect iPhone/iPod:
Run this event once
TouchScreenXSize(WindowControlObject)<640
This works even when you stretch your app to fill canvas. On iPhones and iPod Touch the ScreenXSize returns 320, and on iPad 768 for some reason. I feel safe doing this as I have testet it on iPad 1st gen, iPad 2nd gen, iPad 4, iPod Touch 4th gen and iPhone 4. But I would like to hear results on 5th gen devices? Please share.
But why??
I am making an app with edit boxes, but unfortunately text is rendered differently on iPad vs iPhone. So to control the font size I use the trick above.
Note:
Run this event once is really important, or you will get very low performance. You can of course use any other number between 320 and 768, I just expected it to return 640.