Go to info.plist and add the following keys: Key : Privacy - Camera Usage Description Value : $(PRODUCT_NAME) camera use Key : Privacy - Photo Library Usage Description Value : $(PRODUCT_NAME) photo library use 2. At class: class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate 3. Add to button click function to get camera: if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) { let imagePicker = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = UIImagePickerControllerSourceType.camera; imagePicker.allowsEditing = false present(imagePicker, ani...
Comments
Post a Comment