Reputation: 14562
I have a feature in my app that requires the auto-focus capabilities of the iPhone 4 or iPhone 3GS. How can I programmatically exclude iPhone 3G from loading that particular feature?
Apple recommends not searching for hardware version, but for the specific feature in which you are interested. I'd rather avoid going against Apple's wishes. For example, for this feature, to exclude the iPad, I checked for the existence of the camera like so:
capturePhotoButton.enabled = [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];
What is the equivalent for auto-focus?
Upvotes: 1
Views: 1250
Reputation: 22405
You can always use AVFoundation to check this stuff, AVCaptureDevice class has a method isFocusModeSupported and many other methods to check if a capture device supports different functionalities, here is a reference to the documentation AVCaptureDevice Ref
Hope this helps
Daniel
Upvotes: 4