Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjuly/alassetslibrary-customphotoalbum
A nice ALAssetsLibrary category for saving images & videos into custom photo album.
https://github.com/kjuly/alassetslibrary-customphotoalbum
album ios objective-c photos video
Last synced: 3 days ago
JSON representation
A nice ALAssetsLibrary category for saving images & videos into custom photo album.
- Host: GitHub
- URL: https://github.com/kjuly/alassetslibrary-customphotoalbum
- Owner: Kjuly
- License: mit
- Created: 2012-07-12T12:01:36.000Z (over 12 years ago)
- Default Branch: dev
- Last Pushed: 2018-01-23T13:59:06.000Z (almost 7 years ago)
- Last Synced: 2024-10-19T05:15:19.430Z (28 days ago)
- Topics: album, ios, objective-c, photos, video
- Language: Objective-C
- Homepage: http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/
- Size: 139 KB
- Stars: 405
- Watchers: 32
- Forks: 101
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ALAssetsLibrary-CustomPhotoAlbum
================================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
// |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;# Dependence
1. AssetsLibrary.framework
2. MobileCoreServices.framework
3. Photos.framework (for iOS 8+ projects)# REFERENCE
- [ALAssetsLibrary Class Reference][1]
- [iOS5: Saving photos in custom photo album][2]# Contributors
[@MarinTodorov](http://www.touch-code-magazine.com/about/)
[@Kjuly](https://github.com/Kjuly)
[@coryjthompson](https://github.com/coryjthompson)
[@speedyapocalypse](https://github.com/speedyapocalypse)
[@blazingpair](https://github.com/blazingpair) ([@paulz](https://github.com/paulz))
[@ajcollins](https://github.com/ajcollins)
[@wka](https://github.com/wka)
[@NSFish](https://github.com/NSFish)
[@michaelcameron](https://github.com/michaelcameron)[1]: http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html#//apple_ref/occ/instm/ALAssetsLibrary/addAssetsGroupAlbumWithName:resultBlock:failureBlock:
[2]: http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/