我需要设置UIPopOverController
从库中选择照片。
所以我写了以下代码。
self.imagePickerController = [[UIImagePickerController alloc] init];
self.imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
self.imagePickerController.sourceType = sourceType;
[self.imagePickerController setDelegate:self];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:self.imagePickerController];
[popover presentPopoverFromRect:self.btnArchive.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
imagePickerPopover = popover;
它出现了,我从照片库中选择了一张照片,在我从库中选择后,我使用以下代码关闭了 PopOver。
[self.imagePickerPopover dismissPopoverAnimated:NO];
我需要显示从照片库中选择的图像,所以我在 -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
方法中编写了以下代码。
UIImage *image = [info valueForKey:UIImagePickerControllerOriginalImage];
[self dismissViewControllerAnimated:YES completion:^ {
// Codes Here after dismiss PopOverView and chosen photo from library
}];
但它不起作用。我如何检查它UIPopOverController
?