- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ //前置摄像头 if ([self isFrontCameraAvailable]){ NSLog(@"The front camera is available."); if ([self isFlashAvailableOnFrontCamera]){ NSLog(@"The front camera is equipped with a flash"); } else { NSLog(@"The front camera is not equipped with a flash"); } } else { NSLog(@"前置摄像头不可用"); } //后置摄像头 if ([self isRearCameraAvailable]){ NSLog(@"The rear camera is available."); if ([self isFlashAvailableOnRearCamera]){ NSLog(@"The rear camera is equipped with a flash"); } else { NSLog(@"The rear camera is not equipped with a flash"); } } else { NSLog(@"后置摄像头不可用"); } if ([self doesCameraSupportTakingPhotos]){ NSLog(@"The camera supports taking photos."); } else { NSLog(@"相机不支持拍照"); } if ([self doesCameraSupportShootingVideos]){ NSLog(@"The camera supports shooting videos."); } else { NSLog(@"相机不支持视频拍摄。"); } self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; returnYES; }