Question

Does anyone know the recommended way to check whether the device supports specific capabilities, for example the camera. I know I can detect the device the app is on with UIDevice but I was wondering if there is a way to enumerate the device's capabilities?

Was it helpful?

Solution

I'm not sure if there is a way to enumerate all of the device's capabilities. Usually, this check is done on a capability by capability basis.

So, to use your example, if you would like to know if the device you are running on has the capability to take a picture, you would:

[UIImagePickerController isSourceTypeAvailable:
   UIImagePickerControllerSourceTypeCamera];

This would return true (YES) for any iPhone, and false (NO) for any iPod Touch (at least at the time of this writing).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top