Ios 自定义用于popover视图的UIPopOvercontroller的外观

Ios 自定义用于popover视图的UIPopOvercontroller的外观,ios,uipopovercontroller,customization,popover,Ios,Uipopovercontroller,Customization,Popover,我一直在研究同一个谜题,这个谜题是在这篇文章中用IBAction和NIB解决的: 我想知道,这是否可以,以及如何使用按钮或其他控件的segue来实现?似乎我的segue没有让下面这句话生效: $popover.popoverBackgroundViewClass=[CustomPopoverBackgroundView class]; 因为我的custompopover.h或.m代码没有加载或被调用。有没有人愿意告诉我,我执行得不好 此外,我还使用了本教程中的一些内容,但我似乎仍然错过了如何

我一直在研究同一个谜题,这个谜题是在这篇文章中用IBAction和NIB解决的:

我想知道,这是否可以,以及如何使用按钮或其他控件的segue来实现?似乎我的segue没有让下面这句话生效:

$popover.popoverBackgroundViewClass=[CustomPopoverBackgroundView class];
因为我的custompopover.h或.m代码没有加载或被调用。有没有人愿意告诉我,我执行得不好

此外,我还使用了本教程中的一些内容,但我似乎仍然错过了如何正确实现这一点:


谢谢你的关注

像这样的怎么样

- (IBAction)yourAction:(id)sender {

UIStoryboard *myStoryboard = self.storyboard;
ViewController *myViewController = [myStoryboard instantiateViewControllerWithIdentifier:@"ViewController"]; // Identifier of the vc in attributes inspector, throws exception if not filled in!

//Set myViewController properties here

UIPopoverController *myPopover = [[UIPopoverController alloc] initWithContentViewController:myViewController];
myPopover.popoverBackgroundViewClass = [CustomPopoverBackgroundView class]; 

[myPopover presentPopoverFromRect:CGRectMake(0,0,100,100) inView:self.view permittedArrowDirections:0 animated:YES]; 
}