Created
February 26, 2014 10:17
-
-
Save sgoodwin/9227109 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; | |
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *libraryStop) { | |
NSInteger assetCount = [group numberOfAssets]; | |
NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:assetCount-1]; | |
[group enumerateAssetsAtIndexes:indexes options:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *groupStop) { | |
if(result){ | |
CGImageRef imageRef = [[result defaultRepresentation] fullResolutionImage]; | |
UIImage *image = [UIImage imageWithCGImage:imageRef]]; | |
// Do stuff with the image. | |
} | |
}]; | |
} failureBlock:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment