Permalink
Browse files

[FIX] bug fix for camera albums order

  • Loading branch information...
1 parent b5357fa commit 9dd2660267813f9f69466b02f39eed9370083094 @jayrparro committed Jul 28, 2012
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 9dd2660

Please sign in to comment.