Has anyone found the solution or cause of this?
Here is my code and I've tried switching the order of line 5 to before line 9
@IBAction func takePhoto(sender: UIButton) {
let imagePicker: UIImagePickerController! = UIImagePickerController()
imagePicker.delegate = self
if (UIImagePickerController.isSourceTypeAvailable(.Camera)) {
if UIImagePickerController.availableCaptureModesForCameraDevice(.Front) != nil {
imagePicker.allowsEditing = false
imagePicker.sourceType = .Camera
imagePicker.cameraCaptureMode = .Photo
imagePicker.cameraDevice = .Front
presentViewController(imagePicker, animated: true, completion: {})
} else {
print("Camera not found")
}
} else {
print("Application cannot access the camera.")
}
}