Search code examples
objective-ciosalassetslibraryalasset

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
     }];    

Solution

  • 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.