title: deleting a camera roll asset using Photos framework
body: <p>I'm writing a test application to see if it is possible to delete a "photo library" asset in iOS 8, using the Photos framework. Although I suspect it is not possible, I find the documentation to be unclear, and there are posts on this site that seem to indicate it is possible. See <a href="https://stackoverflow.com/questions/12127004/delete-an-asset-picture-or-video-from-iphone-in-ios">here</a> for example.</p>
  
  <p>In my test app, I pick an asset from the library:</p>
  
  <pre><code>var picker = UIImagePickerController()
  picker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
  picker.mediaTypes = [kUTTypeMovie]
  </code></pre>
  
  <p>In the delegate callback, I get the NSURL of the asset, and put it into an array:</p>
  
  <pre><code>let thePicked = info[UIImagePickerControllerMediaURL] as NSURL!
  var videosToDelete: [NSURL] = [theURL]
  </code></pre>
  
  <p>And here is the part I'm least confident about, where I get the PhotoLibrary, and do a change request to delete the asset:</p>
  
  <pre><code>PHPhotoLibrary.sharedPhotoLibrary().performChanges( {
      let assetToDelete = PHAsset.fetchAssetsWithALAssetURLs(videosToDelete, options: nil)
      PHAssetChangeRequest.deleteAssets(assetToDelete)
  },
      completionHandler: { success, error in
          NSLog("Finished deleting asset. %@", (success ? "Success" : error))
  })
  </code></pre>
  
  <p>The completion handler returns successfully, but the asset is never deleted. Am I doing something wrong? Or am I trying to do something inherently not allowed, and I'm not receiving the correct feedback for it?</p>