Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for Camera Albums order #28

Merged
merged 1 commit into from

2 participants

@jayrparro

Fix for Camera Album order. The "Camera Roll" should be displayed first in the ELCAlbumPickerController

@jvanmetre jvanmetre merged commit ee98818 into B-Sides:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 28, 2012
  1. @jayrparro
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +10 −1 Classes/ELCAlbumPickerController.m
View
11 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];
Something went wrong with that request. Please try again.