I have an option to display a UIImagePicker and select an image from the user’s camera roll within my app. THe issue that I’m running in is that the photos are sorted with the oldest on top. This makes it easy to pick images that have been taken months ago. I want the user to quickly select images that were taken a few minutes ago without having to scroll to the end of the list (bottom of the list).
Is there away to ask the default UIImagePicker to sort its results and display latest ones or at least scroll to the end of the list after being presented?
- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
usingDelegate: (id <UIImagePickerControllerDelegate,
UINavigationControllerDelegate>) delegate {
if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO)
|| (delegate == nil)
|| (controller == nil))
return NO;
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
// Displays a control that allows the user to choose picture or
// movie capture, if both are available:
cameraUI.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
// Hides the controls for moving & scaling pictures, or for
// trimming movies. To instead show the controls, use YES.
cameraUI.allowsEditing = NO;
cameraUI.delegate = delegate;
[controller presentModalViewController: cameraUI animated: YES];
return YES;
}
As indicated in this This question
the solution involves adding an extra step before selecting an image with the line:
This displays the list of available photo libraries and scrolls to the bottom of the selected one.