В приведенном ниже коде показан пример моего доступа к библиотеке изображений. Независимо от того, где я вызываю код (представление), я не вижу всплывающего диалогового окна разрешения с телефона и, следовательно, не могу разрешить моему приложению доступ к камере или библиотеке.
Кроме того, в настройках конфиденциальности не отображается мое приложение. есть идеи? Я схожу с ума.
let imgPicker = UIImagePickerController()
imgPicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
imgPicker.modalPresentationStyle = UIModalPresentationStyle.Popover
self.presentViewController(imgPicker, animated: true, completion: nil)
по другому пробовал
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
let imagePicker:UIImagePickerController = self.imagePickerController
imagePicker.allowsEditing = true
imagePicker.sourceType = UIImagePickerControllerSourceType.Camera
imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo
imagePicker.cameraDevice = UIImagePickerControllerCameraDevice.Rear
imagePicker.showsCameraControls = true
imagePicker.navigationBarHidden = true
imagePicker.toolbarHidden = true
imagePicker.delegate = self
self.presentViewController(imagePicker, animated: true, completion: nil)
}
