Fix for Camera Albums order #28

Merged
merged 1 commit into from Mar 26, 2013
Jump to file or symbol
Failed to load files and symbols.
+10 −1
Split
@@ -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];