ALAssetsLibrary-CustomPhotoAlbum 1.3.4

ALAssetsLibrary-CustomPhotoAlbum 1.3.4

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2018年1月

Kjuly 维护。



  • Kaijie Yu

ALAssetsLibrary-CustomPhotoAlbum (v1.3.0)

@MarinTodorov 提供的一个用于将图片保存到自定义相册的漂亮的 ALAssetsLibrary 分类。

用法

//      |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;

以及对于视频

//   |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;

将图像数据(包括元数据)写入资产库(相册)。

//  |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;

依赖关系

  1. AssetsLibrary.framework
  2. MobileCoreServices.framework
  3. Photos.framework(适用于 iOS 8+ 项目)

参考

贡献者

@MarinTodorov
@Kjuly
@coryjthompson
@speedyapocalypse
@blazingpair (@paulz)
@ajcollins
@wka
@NSFish
@michaelcameron