How can I use NSDocument to store the images in Swift iOS programmatically?
let alertController = UIAlertController(title: "Choose an option", message: "", preferredStyle: .Alert)
let cameraRollAction = UIAlertAction(title: "Camera Roll", style: .Default) { (action) in
self.imagePicker.delegate = self
self.imagePicker.sourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum;
self.imagePicker.allowsEditing = true
self.presentViewController(self.imagePicker, animated: true, completion: nil)
}
alertController.addAction(cameraRollAction)
let takePictureAction = UIAlertAction(title: "Take a picture", style: .Default) { (action) in
self.imagePicker.delegate = self
self.imagePicker.allowsEditing = true
self.imagePicker.sourceType = UIImagePickerControllerSourceType.Camera
self.imagePicker.cameraCaptureMode = .Photo
self.imagePicker.modalPresentationStyle = .FullScreen
self.presentViewController(self.imagePicker,
animated: true,
completion: nil)
}
I need to store the images when selecting the button and retrieve them when required.