TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Alexey Belkevich.
APPhotolibrary is a wrapper on ALAssetsLibrary and a category for ALAsset
Add APPhotolibrary
pod to Podfile
APPhotolibrary *photolibrary = [[APPhotolibrary alloc] init];
[photolibrary loadPhotosAsynchronously:^(NSArray *assets, NSError *error)
{
if (!error)
{
// show assets
}
else
{
// show error
}
}];
photolibrary.sortAscending = YES;
photolibrary.sortComparator = ^NSComparisonResult(ALAsset *asset1, ALAsset *asset2)
{
// return result of comparsion two assets
};
Default sort is by date
#import "ALAsset+Photo.h"
...
ALAsset *asset = // assign asset
// photo thumbnail
self.thumbnailImageView.image = asset.photoThumbnail;
// load fullscreen photo (size depends on device screen)
__weak __typeof(self) weakSelf = self;
[asset loadPhotoInFullScreenAsynchronously:^(UIImage *image)
{
weakSelf.fullScreenImageView.image = image;
}];
// load full resolution photo
[asset loadPhotoInFullResolutionAsynchronously:^(UIImage *image)
{
weakSelf.fullScreenImageView.image = image;
}];
Check out all Alterplay's GitHub projects. Email us with other ideas and projects.