Skip to content

Instantly share code, notes, and snippets.

@nodahikaru
Last active October 20, 2018 01:38
Show Gist options
  • Save nodahikaru/f755ee3e37782221d7d8f3770af8013e to your computer and use it in GitHub Desktop.
Save nodahikaru/f755ee3e37782221d7d8f3770af8013e to your computer and use it in GitHub Desktop.
@import Photos;
@import AVKit;
[PHPhotoLibrary.sharedPhotoLibrary performChanges:^{
NSURL *url = [NSURL fileURLWithPath:[FileUtil filePath:fileName]];
[PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:url];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
if (error) {
NSLog(@"Error : %@", error);
}
if (success) {
NSLog(@"Finished updating assets.");
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment