// Check the front and rear cameras BOOL cameraAvailable = [UIImagePickerController isCameraDeviceAvailable: enabled]; // The Front BOOL frontCameraAvailable = [UIImagePickerController enabled: enabled]; // The back // check the CoreLocation. framework <CoreLocation/CoreLocation. h> BOOL magnetometerAvailbale = [CLLocationManager headingAvailable]; // check that the sound supports AVFoundation. framew Ork <AVFoundation/AVFoundation. h> AVAudioSession * audioSession = [AVAudioSession sharedInstance]; // returns an AVAudioSession instance BOOL audioAvailable = audioSession. inputAvailable; // bool value. Obtain whether the video is supported // check whether the video supports MobileCoreServices. framework <MobileCoreServices/MobileCoreServices. h>-(BOOL) isvideoCameraAvailable {// check all available media resource types, and then check the returned array. If the returned array contains the NSString object of the kUTTypeMovie type, this proves that the camera supports video recording: UIImagePickerController * picker = [[UIImagePickerController alloc] init]; NSArray * sourceTypes = [UIImagePickerController availableMediaTypesForSourceType: picker. sourceType]; // return the supported media type array [picker release]; I F (! [SourceTypes containsObject :( NSString *) kUTTypeMovie]) {// containsObject determines whether the array contains the following object return NO;} return YES;} // check whether CoreMotion is available for gyroscope. framework <CoreMotion/CoreMotion. h>-(BOOL) isGyroscopeAvailable {# ifdef _ IPHONE_4_0 // CMMotionManager * motionManager = [[CMMotionManager alloc] init]; BOOL gyroscopeAvailable = motionManager. gyroAvailable; [motionManager release]; return gyroscopeAvailable; # else return NO; # endif}