I'm working on a program that needs to be able to detect whether or not camera hardware is present in the iPad. I assumed that the easiest way to do this was to determine what generation the device was, but if there is a simpler way to detect the hardware that works too. The iPads that this application is being designed for will likely be recently purchased and running on a standard updated version of iOS.
Asked
Active
Viewed 538 times
2
-
http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk – netdigger Aug 01 '12 at 16:43
-
I'm not really looking for what device it is as they will all be iPads of some sort. I'm really just interested in what generation of iPad it is. – Logan S. Aug 01 '12 at 16:50
-
Thats exactly the same answer as the question I did post. – netdigger Aug 01 '12 at 17:42
1 Answers
2
Nope You can simply check what device is being used!
For checking all iOS devices:
NSString *deviceType = [UIDevice currentDevice].model;
NSLog(deviceType);
In order to check for a camera
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
//there is a camera

chaitanya.varanasi
- 960
- 1
- 9
- 26
-
Will the first choice tell me what generation the device is in addition to which device (ipod, iphone, ipad) the app is running on? – Logan S. Aug 01 '12 at 16:53