Skip to content

icanzilb/ALAssetsLibrary-CustomPhotoAlbum

 
 

Repository files navigation

ALAssetsLibrary-CustomPhotoAlbum

Description

A nice ALAssetsLibrary category for saving images into custom photo album by @MarinTodorov.

Usage

//           |image|: the target image to be saved
//       |albumName|: custom album name
// |completionBlock|: block to be executed when succeed to write the image data
//                    to the assets library (camera roll)
//    |failureBlock|: block to be executed when failed to add the asset to the
//                    custom photo album
- (void)saveImage:(UIImage *)image
          toAlbum:(NSString *)albumName
  completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock
     failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock;

And for video:

//        |videoUrl|: the target video to be saved
//       |albumName|: custom album name
// |completionBlock|: block to be executed when succeed to write the image data
//                    to the assets library (camera roll)
//    |failureBlock|: block to be executed when failed to add the asset to the
//                    custom photo album
- (void)saveVideo:(NSURL *)videoUrl
          toAlbum:(NSString *)albumName
  completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock
     failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock;

Dependence

  1. AssetsLibrary.framework
  2. MobileCoreServices.framework

REFERENCE:

About

A nice ALAssetsLibrary category for saving images & videos into custom photo album. by @marintodorov.

Resources

License

Stars

Watchers

Forks

Packages

No packages published