How can I put a button when I click on the option to choose a photo from the library or take one directly?
At the moment I can only use one of the two options via code.
@IBAction func cogerImagen(_ sender: UIButton) {
self.imagePicker = UIImagePickerController()
self.imagePicker.delegate = self
self.imagePicker.sourceType = .photoLibrary
self.imagePicker.isEditing = true
present(self.imagePicker, animated: true, completion: nil)
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
self.imagePicker.dismiss(animated: true, completion: nil)
/*let imageView: UIImageView = UIImageView()
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage*/
}