Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added scrollToBottom property for image picker, fixed 'Pick Photos' i…

…n single selection mode
  • Loading branch information...
commit 01dfb6c0e5c11eda2f697ec68d28f166c677e331 1 parent 09246df
Jack Nutting jnutting authored
1  Classes/ELCAssetTablePicker.h
View
@@ -28,6 +28,7 @@
@property (nonatomic, retain) IBOutlet UILabel *selectedAssetsLabel;
@property (nonatomic, assign) BOOL singleSelection;
@property (nonatomic, assign) BOOL immediateReturn;
+@property (nonatomic, assign) BOOL startAtBottom;
-(int)totalSelectedAssets;
-(void)preparePhotos;
13 Classes/ELCAssetTablePicker.m
View
@@ -84,9 +84,18 @@ -(void)preparePhotos {
[self.elcAssets addObject:elcAsset];
}];
NSLog(@"done enumerating photos");
-
+
[self.tableView reloadData];
- [self.navigationItem setTitle:@"Pick Photos"];
+ // scroll to bottom
+ int section = [self numberOfSectionsInTableView:self.tableView] - 1;
+ int row = [self tableView:self.tableView numberOfRowsInSection:section] - 1;
+ NSIndexPath *ip = [NSIndexPath indexPathForRow:row
+ inSection:section];
+ [self.tableView scrollToRowAtIndexPath:ip
+ atScrollPosition:UITableViewScrollPositionBottom
+ animated:NO];
+
+ [self.navigationItem setTitle:self.singleSelection ? @"Pick Photo" : @"Pick Photos"];
[pool release];
2  Classes/ELCImagePickerDemoViewController.m
View
@@ -56,6 +56,8 @@ - (void)displayPickerForGroup:(ALAssetsGroup *)group {
ELCAssetTablePicker *tablePicker = [[ELCAssetTablePicker alloc] initWithNibName:@"ELCAssetTablePicker" bundle:[NSBundle mainBundle]];
tablePicker.singleSelection = YES;
tablePicker.immediateReturn = YES;
+ tablePicker.startAtBottom = YES;
+
ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:tablePicker];
elcPicker.delegate = self;
tablePicker.parent = elcPicker;
Please sign in to comment.
Something went wrong with that request. Please try again.