Add NSCameraDescription (Privacy-Camera Usage Description) key in info.plist to describe the need for using camera.
Test authorization before each camera setup.
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.
Test authorization before saving media.
PHPhotoLibrary and PHAssetCreationRequest provide read/write function for Photos library. Add NSPhotoLibraryUsageDescription to info.plist.
UISavePhotoAtPathtoSavedPhotosAlbum provide an easier access to save movie files. Add NSPhotoLibraryAddUsageDescription to info.plist.