I am trying to create a project using this tutorial. I did the best I could trying to recreate the code but am having some problems. Here is my code:
class ViewC
Your code is senseless. You are saying:
actionSheet.addAction(UIAlertAction(title: "Camera roll", style: UIAlertActionStyle.Default, handler: { ( alert: UIAlertAction!) -> Void in
imagePickerController.sourceType = UIImagePickerControllerSourceType.Camera
self.presentViewController(imagePickerController, animated: true, completion: nil)
} ))
If the user is going to tap a "Camera roll" button, why would you then create an image picker controller with a Camera
source type? That isn't what the user asked for.
The error, by the way, simply means there is no camera. You are not trying to run this code in the Simulator, are you? That would be senseless too. The camera exists only on a device — a device with a camera.