I am developing a Cocoa Touch application for Apple's App store and I want to do some tweaking in the code depending on what device it's running on. How can I tell?
Asked
Active
Viewed 477 times
0
-
1possible duplicate of [API to determine whether running on iPhone or iPad](http://stackoverflow.com/questions/2884391/api-to-determine-whether-running-on-iphone-or-ipad) – kennytm Jun 04 '10 at 17:54
3 Answers
4
I've used this in a Universal app to determine if the code is running on an iPad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
// Do iPad only stuff here
}

Ken Pespisa
- 21,989
- 3
- 55
- 63
0
Look at UIDevice
and it's properties. There is a systemVersion
string that will work for what you want.

Caleb Hearth
- 3,315
- 5
- 30
- 44