I have an app that uses the following Macro:
#define IS_IPAD ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
which works very well for me.
However, I was using it to turn off the option of taking a photo in the app.
How can I detect if the camera option is available regardless of device?
[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];
That should work
See How to Detect Camera Existence with AVFoundation.
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
AVCaptureDevice *captureDevice = nil;
if ( [videoDevices count] > 0 ) // This device has one or more cameras
....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With