Directly on the code:
Alassetslibrary *library =[[Alassetslibrary alloc] init]; [Library Enumerategroupswithtypes:alassetsgroupsavedphotos Usingblock:^ (Alassetsgroup *group, BOOL *stop) { //Filter down to only photos[group Setassetsfilter:[alassetsfilter Allphotos]]; //Grab The first photo return[Group Enumerateassetsatindexes:[nsindexset Indexsetwithindex:0] Options:0Usingblock:^ (Alasset *result, Nsuinteger index, BOOL *stop) { if(Result) { IDRepressentation =[result Defaultrepresentation]; //can produce a avassetNsurl *url =[repressentation URL]; Avasset*asset =[Avasset Assetwithurl:url]; //You can also get the image directlySelf.view.backgroundColor =[Uicolor colorwithpatternimage:[uiimage imagewithcgimage:[repressentation Fullresolutionimage]]; } }]; } Failureblock:^ (Nserror *error) {NSLog (@"Error:%@", [Error localizeddescription]); }];
ios-use Alassetslibrary to get photo album Pictures video