我想通过准备segue方法打开UIPopoverPresentationController我尝试了以下代码,但它显示了一些警告错误消息,如" UIStoryboardPopoverSegue已弃用:首先在iOS 9.0中弃用" - 从您的访问destinationviewcontroller.popoverpresentation segue执行选择器或覆盖执行....
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
UIStoryboardPopoverSegue* popover = (UIStoryboardPopoverSegue*)segue;
CGFloat horizontalInset = (self.frame.size.width - popover.popoverController.popoverContentSize.width) / (CGFloat)2.0;
CGFloat verticalInset = (self.frame.size.height - popover.popoverController.popoverContentSize.width) / (CGFloat)2.0;
popover.popoverController.popoverLayoutMargins =
UIEdgeInsetsMake(
verticalInset,
horizontalInset,
verticalInset,
horizontalInset);
}}