Last active
October 20, 2018 01:38
-
-
Save nodahikaru/f755ee3e37782221d7d8f3770af8013e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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