title: How to take a picture and save it to the app locally with swift
body: <p>I'm working on an app where in the current stage when a user takes a picture the picture will be stored locally within the app. </p>
  
  <pre><code> @IBAction func CameraAction(sender: UIButton) {
  let picker = UIImagePickerController()
      picker.delegate = self
      picker.sourceType = .Camera
      picker.allowsEditing = true
      self.presentViewController(picker, animated: true, completion: nil)
  }
  
  func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
      picker.dismissViewControllerAnimated(true, completion: nil)
  
      //Save image
      let img = UIImage()
      let data = UIImagePNGRepresentation(img)
      NSUserDefaults.standardUserDefaults().setObject(data, forKey: "myImageKey")
      NSUserDefaults.standardUserDefaults().synchronize()
      NSLog("Image stored?")
      viewDidLoad()
  
  
  }
  </code></pre>
  
  <p>From what I have above, my iPhone opens up its camera and I can take a picture. When I hit capture and the "use this image" option I don't think it the pictures are actually being stored because I haven't been able to recall the pictures.</p>
  
  <p>So I'm asking for help in how to locally store a picture taken from the UIImagePickerController, possibly in the documents folder, how to recall it, and how to do it <strong>without NSUserDEfaults</strong>. Thanks.</p>