Ios8.0 previously obtained the album has Uiimagepicker (but only one at a time), if you need to select multiple, you can only customize picker
The framework used here is assetslibrary.framework, resource pool,
#import <AssetsLibrary/ALAsset.h>//Picture basic information
#import <AssetsLibrary/ALAssetsFilter.h>//group Filter, remember that only one
#import <assetslibrary/alassetsgroup.h>//Get albums
#import <assetslibrary/alassetslibrary.h>//the whole class library management class bar
#import <AssetsLibrary/ALAssetRepresentation.h>//images for more information
My side of the simple package, the general process is to get the album first, and then get the photos in the album, relatively simple, directly on the code bar
-(Nsmutabledictionary *) detailgroups {if(!_detailgroups) {_detailgroups=@{}.mutablecopy; } return_detailgroups;}-(Alassetslibrary *) Library {if(!_library) {_library=[[Alassetslibrary alloc]init]; } return_library;}-(Nsmutablearray *) assesgroups {if(!_assesgroups) {_assesgroups=@[].mutablecopy; } return_assesgroups;}+ (Liuasset *) Shareasset {Staticdispatch_once_t Oncetoken; Dispatch_once (&oncetoken, ^{_shareasset=[[Liuasset alloc]init]; }); return_shareasset;}- (void) Releaseobj {if(_shareasset) {_shareasset=Nil; }}///get all the groupings- (void) Getassetsgroups: (Getassetsgroupsblock) Assetsgroup {if(Self.assesGroups.count! =0) { if(Assetsgroup) {assetsgroup (self.assesGroups.copy); return; }; } [Self.library Enumerategroupswithtypes:alassetsgroupall usingblock:^ (Alassetsgroup *group, BOOL *stop) { //just need photoAlassetsfilter *onlyphotos =[Alassetsfilter Allphotos]; if(group) {[Group Setassetsfilter:onlyphotos]; if([group Numberofassets] >0) {[self.assesgroups addobject:group]; } }Else { //here should be in accordance with *stop to judge, seemingly debugging when found this stop is no, but there is a reference is here the group when the last one will be nil, according to this judge if(Assetsgroup) {assetsgroup (self.assesGroups.copy); return; }}} Failureblock:^ (Nserror *error) { }]; }///get group All Alasset- (void) Getallassetsbygroup: (Alassetsgroup *) Group Finish: (getassetsblock) finish{nsstring*groupname =[group Valueforproperty:alassetsgrouppropertyname]; __block Nsmutablearray*allassets =[Self.detailgroups Objectforkey:groupname]; if(allassets) {//return the data. if(finish) {finish (allassets.copy); } return; } //If there is no dataAllassets =@[].mutablecopy; [Group Enumerateassetsusingblock:^ (Alasset *result, Nsuinteger index, BOOL *stop) { //I don't know why the stop here is wrong. if(Result) {[Allassets addobject:result]; }Else { //Save the array in the dictionary first[self.detailgroups setobject:allassets forkey:groupname]; if(finish) {finish (allassets.copy); } return; } }];}///Get full screen view-(UIImage *) Getfullimagewitasset: (Alasset *) Asset {return[UIImage imagewithcgimage:[[asset defaultrepresentation] fullscreenimage];}///get thumbnail images-(UIImage *) Getthumbimagewithasset: (Alasset *) Asset {return[UIImage imagewithcgimage:[asset thumbnail];}
iOS 8, Apple abandoned the class library, a new photos class, next time to clean up the class library
Assetslibrary/assetslibrary.h album Get