Save GIF image data to Camera Roll

We often use this piece code to save UIIMage to camera roll:

    UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:ImageData], self,@selector(image:didFinishSavingWithError:contextInfo:), nil);

However when we meet GIF, we need to use :

    ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
    [library writeImageDataToSavedPhotosAlbum:ImageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
        // Continue as normal...
    }];
comments powered by Disqus