Camera Authorization

  1. Add NSCameraDescription (Privacy-Camera Usage Description) key in info.plist to describe the need for using camera.
  2. Test authorization before each camera setup.
  3. Test AVCaptureDevice.authorizationStatus(for:), four results are possible: 1. .authorized, .denied, .restricted 2. Upon .notDetermined , use requestAccess(for:completionHandler:) to prompt user. Note completionHandler is async execution.
  4. Test authorization before saving media.
    1. PHPhotoLibrary and PHAssetCreationRequest provide read/write function for Photos library. Add NSPhotoLibraryUsageDescription to info.plist.
    2. UISavePhotoAtPathtoSavedPhotosAlbum provide an easier access to save movie files. Add NSPhotoLibraryAddUsageDescription to info.plist.