I have a storyboard where I created a UINavigationController
instance and set its custom class to UIImagePickerController
.
If I set imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera
in prepareForSegue
, everything works fine.
If I set imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary
in prepareForSegue
, I get a mostly black screen with an empty gray bar on top that I can't dismiss:
[future location of screenshot - I cannot post images]
I can work around this by not using the storyboard. The question I have-- can this be made to work with the storyboard? If not, why not? Why does it only work for presenting the camera?
EDIT: A colleague comments that this may be a new issue for ios7
The code below doesn't work if the segue is triggered by a storyboard
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSAssert([segue.destinationViewController isKindOfClass:[UIImagePickerController class]], @"Destination VC should be UIImagePickerController");
UIImagePickerController *imagePicker = (UIImagePickerController*) segue.destinationViewController;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
}