title: Can not save file inside tmp directory
body: <p>I have this function to save an image inside the tmp folder</p>
  
  <pre><code>private func saveImageToTempFolder(image: UIImage, withName name: String) {
  
      if let data = UIImageJPEGRepresentation(image, 1) {
          let tempDirectoryURL = NSURL.fileURLWithPath(NSTemporaryDirectory(), isDirectory: true)
          let targetURL = tempDirectoryURL.URLByAppendingPathComponent("\(name).jpg").absoluteString
          print("target: \(targetURL)")
          data.writeToFile(targetURL, atomically: true)
      }
  }
  </code></pre>
  
  <p>But when I open the temp folder of my app, it is empty. What am I doing wrong to save the image inside the temp folder?</p>