Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission to take photo OR get image from library not shown in iOS9 (Xcode 7beta, Swift2)

The code below shows an example for my access to the image lib. No matter where I call the code (view) I do not see the permission dialog from the phone popping up and therefore cannot allow my app to access either camera or library.

Also, the privacy settings do not show my app either. Any thoughts? I'm going nuts.

       let imgPicker = UIImagePickerController()
        imgPicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
        imgPicker.modalPresentationStyle = UIModalPresentationStyle.Popover
        self.presentViewController(imgPicker, animated: true, completion: nil)

another way I tried

            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)
            }
like image 857
DirkLX Avatar asked Sep 28 '22 06:09

DirkLX


1 Answers

You need to set a new pair of Info.plist values, same as the String for Location Services would be in iOS8:

Just set your description string for those.

Info.plist

like image 105
longbow Avatar answered Dec 31 '22 21:12

longbow