0

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?

Douwe Maan
  • 6,888
  • 2
  • 34
  • 35
Allyn
  • 20,271
  • 16
  • 57
  • 68
  • 1
    possible 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 Answers3

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
1

Check out the documentation for UIDevice

falconcreek
  • 4,170
  • 1
  • 21
  • 22
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