Buron
Buron

Reputation: 1233

AssetsLibrary, how to enumerate all photos?

Is there better way to enumerate all photos on the device than this one?

for each asset group do this ...

[currentGroup enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) 
     {         
         if(result == nil) 
         {
             return;
         }
         // add the asset
     }];    

Upvotes: 2

Views: 1125

Answers (2)

user953175
user953175

Reputation: 205

The constant ALAssetsGroupAll is used for enumerating groups of certain or all types. It's used when enumerating the library fishing for groups. But the only way to get all photos, or any type of asset for that matter is to enumerate as you've already coded.

Upvotes: 1

Tark
Tark

Reputation: 5173

You can just do this once by enumerating the group ALAssetsGroupLibrary, which contains all the images in the other groups.

Upvotes: 0

Related Questions