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,798
  • 2
  • 33
  • 34
Allyn
  • 20,041
  • 16
  • 56
  • 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,524
  • 3
  • 55
  • 63
1

Check out the documentation for UIDevice

falconcreek
  • 4,120
  • 1
  • 19
  • 21
0

Look at UIDevice and it's properties. There is a systemVersion string that will work for what you want.

Caleb Hearth
  • 3,263
  • 5
  • 29
  • 44