2018-01-16判断相机

pragma mark - 摄像头和相册相关的公共类

// 判断设备是否有摄像头

 - (BOOL) isCameraAvailable{  
  return [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];  
}  

// 前面的摄像头是否可用

  - (BOOL) isFrontCameraAvailable{  
 return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront];  
   }  

// 后面的摄像头是否可用

 - (BOOL) isRearCameraAvailable{  
 return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear];  

}

你可能感兴趣的:(2018-01-16判断相机)