Take the 2-minute tour ×

Actually I can detect the iOS version but it is possible to detect a iPhone model 3G or 3GS inside iOS?


share|improve this question
possible duplicate of how do I detect whether I have iPhone 2G,3G,3GS –  Evan Mulawski Aug 17 '11 at 14:42
Check for the capabilities that you need (ie: video, phone, compass, gyros, etc) rather than check for specific models. –  progrmr Aug 25 '11 at 22:56

2 Answers 2

up vote 1 down vote accepted

You can find the exact model string using this post (which I think is also a duplicate question):

#include <sys/types.h>
#include <sys/sysctl.h>

@implementation UIDevice (Hardware)

 iPhone1,1 -> iPhone 1G
 iPhone1,2 -> iPhone 3G 
 iPod1,1   -> iPod touch 1G 
 iPod2,1   -> iPod touch 2G 

-(NSString *) platform
  size_t size;
  char *machine = malloc(size);
  NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
 return platform;
share|improve this answer

You need to check for device capabilities. The 3g does not support video recorder and the 3gs does not support front facing camera. Take a look to this question.

share|improve this answer

Your Answer


