title: ios - Simple example to get list of photo albums?
body: <p>I'm trying to get a list of photo albums available in the device using <a href="https://developer.apple.com/library/ios/samplecode/MyImagePicker/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010135" rel="noreferrer">the reference from here</a>: </p>
  
  <p>So far I have this in my viewDidLoad:</p>
  
  <pre><code>// Get albums
  NSMutableArray *groups = [NSMutableArray new];
  ALAssetsLibrary *library = [ALAssetsLibrary new];
  
  ALAssetsLibraryGroupsEnumerationResultsBlock listGroupBlock = ^(ALAssetsGroup *group, BOOL *stop) {
      if (group) {
          [groups addObject:group];
      }
  };
  NSUInteger groupTypes = ALAssetsGroupAlbum;
  [library enumerateGroupsWithTypes:groupTypes usingBlock:listGroupBlock failureBlock:nil];
  
  NSLog(@"%@", groups);
  </code></pre>
  
  <p>However, nothing is added to the groups array. I am expecting to see 2 items from the NSLog.</p>