Determine device (iPhone, iPod Touch) with iOS

Viewed 196755

Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible.

31 Answers

You can use the UIDevice class like this:

NSString *deviceType = [UIDevice currentDevice].model;

if([deviceType isEqualToString:@"iPhone"])
    // it's an iPhone

I've created an extension that lets you to have 3 levels of identification:

  1. type of device
  2. type of iPhone/iPad by inch
  3. model of device

It updates with last iOS devices

UIDeviceDetector

Related