Permalink
Browse files

Merge pull request #28 from jayrparro/master

Fix for Camera Albums order
  • Loading branch information...
2 parents 8052a42 + 9dd2660 commit ee98818d96259f6350c107107115071561edde27 jvanmetre committed Mar 26, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 Classes/ELCAlbumPickerController.m
@@ -44,7 +44,16 @@ - (void)viewDidLoad {
return;
}
- [self.assetGroups addObject:group];
+ // added fix for camera albums order
+ NSString *sGroupPropertyName = (NSString *)[group valueForProperty:ALAssetsGroupPropertyName];
+ NSUInteger nType = [[group valueForProperty:ALAssetsGroupPropertyType] intValue];
+
+ if ([[sGroupPropertyName lowercaseString] isEqualToString:@"camera roll"] && nType == ALAssetsGroupSavedPhotos) {
+ [self.assetGroups insertObject:group atIndex:0];
+ }
+ else {
+ [self.assetGroups addObject:group];
+ }
// Reload albums
[self performSelectorOnMainThread:@selector(reloadTableView) withObject:nil waitUntilDone:YES];

0 comments on commit ee98818

Please sign in to comment.