#import <Foundation/Foundation.h>
#import <Photos/Photos.h>
int saveGifToGallery(const char *path0){
NSString *path = [NSString stringWithUTF8String:path0];
NSData *data = [NSData dataWithContentsOfFile:path];
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init];
[[PHAssetCreationRequest creationRequestForAsset] addResourceWithType:PHAssetResourceTypePhoto data:data options:options];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
NSLog(@":%d",success);
}];
return 1;
}
出典
2017-09-04 05:03:42
ina
PLSはPHPhotoLibrary、https://stackoverflow.com/questions/27008641/save-images-with-phimagemanager-to-custom-album – Rivendell
感謝をしてみてください!枠組みの基盤と写真を追加PHPhotoLibraryに基づいたソリューションをまとめる – ina