iOS开发之将GIF存储本地相册

#import <AssetsLibrary/AssetsLibrary.h>

1、引用库 

 

2、将GIF图片转为NSData类型

 

3、存储代码

        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeImageDataToSavedPhotosAlbum:data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
            NSLog(@"Success at %@", [assetURL path] );
        }];

 

posted @ 2022-03-18 10:14  kawerd  阅读(305)  评论(0编辑  收藏  举报