A nice ALAssetsLibrary category for saving images into custom photo album by @MarinTodorov.
// |image|: The target image to be saved
// |albumName|: Custom album name
// |completion|: Block to be executed when succeed to write the image data
// to the assets library (camera roll)
// |failure|: Block to be executed when failed to add the asset to the
// custom photo album
- (void)saveImage:(UIImage *)image
toAlbum:(NSString *)albumName
completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
failure:(ALAssetsLibraryAccessFailureBlock)failure;
And for video:
// |videoUrl|: The target video to be saved
// |albumName|: Custom album name
// |completion|: Block to be executed when succeed to write the image data
// to the assets library (camera roll)
// |failure|: Block to be executed when failed to add the asset to the
// custom photo album
- (void)saveVideo:(NSURL *)videoUrl
toAlbum:(NSString *)albumName
completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
failure:(ALAssetsLibraryAccessFailureBlock)failure;
Write the image data with meta data to the assets library (camera roll).
// |imageData|: The image data to be saved
// |albumName|: Custom album name
// |metadata|: Meta data for image
// |completion|: Block to be executed when succeed to write the image data
// |failure|: block to be executed when failed to add the asset to the custom photo album
- (void)saveImageData:(NSData *)imageData
toAlbum:(NSString *)albumName
metadata:(NSDictionary *)metadata
completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
failure:(ALAssetsLibraryAccessFailureBlock)failure;
- AssetsLibrary.framework
- MobileCoreServices.framework
@MarinTodorov
@Kjuly
@coryjthompson
@speedyapocalypse
@blazingpair (@paulz)
@ajcollins
@wka
@NSFish