Skip to content

Instantly share code, notes, and snippets.

@makthrow
Created September 22, 2016 20:08
Show Gist options
  • Save makthrow/facb5b3122c0f8fb7ab76bbe69e6a90c to your computer and use it in GitHub Desktop.
Save makthrow/facb5b3122c0f8fb7ab76bbe69e6a90c to your computer and use it in GitHub Desktop.
// TODO: iOS9.0 - rewrite using Photos framework
PHPhotoLibrary.shared().performChanges({
let request = PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputFileURL)
}, completionHandler: { (success, error) in
if !success { NSLog("error creating asset: \(error)") }
})
// ALAssetsLibrary().writeVideoAtPath(toSavedPhotosAlbum: outputFileURL, completionBlock: {
// (assetURL:URL!, error:NSError!) in
// if error != nil{
// print(error)
//
// }
//
// do {
// try FileManager.default.removeItem(at: outputFileURL)
// } catch _ {
// }
//
// if backgroundRecordId != UIBackgroundTaskInvalid {
// UIApplication.shared.endBackgroundTask(backgroundRecordId)
// }
//
// })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment