試すことができれば
NSMutableArray *assetGroups = [[NSMutableArray alloc] init];
void (^assetGroupEnumerator) (ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
{
if(group != nil)
{
[group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
{
//ALAssetRepresentation holds all the information about the asset being accessed.
if(result)
{
ALAssetRepresentation *representation = [result defaultRepresentation];
if (representation !=nil)
{
UIImage *PhotoThumbnail = [UIImage imageWithCGImage:[result thumbnail]];
[fetchedThumbnails addObject:PhotoThumbnail];
UIImage * latestPhoto = [UIImage imageWithCGImage:[result thumbnail]];
[fetchedImages addObject:latestPhoto];
}
}
}];
[assetGroups addObject:group];
}
galleryImagesCV.hidden=NO;
[galleryImagesCV reloadData];
};
assetGroups = [[NSMutableArray alloc] init];
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
NSUInteger groupTypes = ALAssetsGroupSavedPhotos;
[library enumerateGroupsWithTypes:groupTypes usingBlock:assetGroupEnumerator failureBlock:^(NSError *error)
{
NSLog(@"A problem occurred");
}];
import AssetsLibrary/AssetsLibrary.h
これにより、ギャラリーのすべての画像が配列で提供されます。これらをカスタムビューで表示し、選択/交換などを行うことができます.
それが役に立てば幸い