Как я могу использовать NSDocument для программной обработки изображений в программе Swift iOS?Как использовать NSDocument для хранения изображений
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)
}
Мне нужно сохранить изображения при выборе кнопки и получить их при необходимости.
видеть эту ссылку [сохранить] (http://stackoverflow.com/questions/28066688/how-to-save-an-image-path-within-my- app) и [retrieve] (http://stackoverflow.com/questions/29005381/get-image-from-documents-directory-swift) –