A custom view for iOS developers that lets you choose between gallery and camera from UIImagePickerController. Flat design. Icons by https://icons8.com.
Add the following delegate to your viewcontroller:
class ViewController: UIViewController, FlatImagePickerViewControllerDelegate
and call it inside an action:
var flat = FlatImagePickerViewController(shouldSaveImage: false)
flat.delegate = self
self.presentViewController(flat, animated: false, completion: nil)
Use this protocol to save the selected image:
func FlatimagePickerViewController(imagePicker:FlatImagePickerViewController, didSelectImage image: UIImage)
and this one to know when the cancel button is pressed:
func FlatimagePickerViewControllerDidCancel(imagePicker:FlatImagePickerViewController)