I have an alert that asks user if he/she want a picture from Photo App or Camera (UIImagePickerControllerSourceTypePhotoLibrary
or UIImagePickerControllerSourceTypeCamera
).
When the user selects the image in both case, I push a view controller like that:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage *pickedImage = [info
objectForKey:UIImagePickerControllerOriginalImage];
PhotoViewController* controller = [[PhotoViewController alloc]initWithNibName:@"PhotoViewController" bundle:nil photo:pickedImage];
[picker pushViewController:controller animated:YES];
}
When users choose for UIImagePickerControllerSourceTypePhotoLibrary
there is no problem, because my controller will be inside the UINavigatorController. So user can go back to previous Navigation.
But when users choose for UIImagePickerControllerSourceTypeCamera
the UINavigation is not in the top of my view. I need it because I want to create a CANCEL button.
I use the same view in both case.
Do you have a suggestion for me, please? How could I see the UINavigation from the UIImagePicker in my PhotoViewController after user takes a picture?
Thanks a lot
I used this code in my PhotoViewControler to solve my problem:
- (void)viewDidLoad{
...
...
[self.navigationController setNavigationBarHidden:NO animated:YES];
...
...
}