Marco
Marco

Reputation: 340

How to extend UIImagePickerController with a custom view controller?

Because the default cropping frame of an UIImagePickerController (when using the setting setAllowsEditing:YES) isn't the right size for me I've created a custom view controller, like suggested here.

When a thumbnail is selected from the UIImagePickerController I open this custom view controller (navigationController) from - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info:

[popoverController setContentViewController:navigationController animated:YES];

But it seems that the UIImagePickerController is already closed, because the custom view controller is presented without animation. And when I cancel the custom view controller I can't go back to the UIImagePickerController's thumbnail view. Is there a way to extend the UIImagePickerController so you return to the UIImagePickerController when canceling the custom view controller?

Thanks!

Upvotes: 1

Views: 1999

Answers (1)

Randall
Randall

Reputation: 14839

UIImagePickerController is a UINavigationController. That means you can push and pop things onto the stack all you want. Instead of setting a new view controller, just push your controller onto the image picker stack.

Upvotes: 2

Related Questions