I really hope I'm not making a duplicate - but I read a ton different camera-questions inhere and implemented all of their answers, with the same result: Nothing happens!
No errors, the app doesn't crash, no problems whatsoever - only there is no sign of the camera, which should be activated! My goal is to get it activated in viewDidAppear or viewDidLoad, but I also tried testing it by connecting the code to a button - same result; nothing. Both on my own device and on the simulator: nothing!
What am i getting wrong in this simple code?? - Or which setting do I need to change? I have tried playing with the "data protection": nothing!
Code:
class CreateNewPerson: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func viewDidAppear () {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = .camera
present(imagePicker, animated: true, completion: nil)
}
private func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]!) {
PersonPhoto.image = info[UIImagePickerControllerOriginalImage] as? UIImage
dismiss(animated: true, completion: nil)
}
Hope someone can help me!
Photo of info.plist (where I can't seem to find the camera ussage description) - maybe I'm an idiot...:
Thanks!