0

I've been working on the same puzzle that was solved with an IBAction and a NIB over at this Post:

UIPopover customization Post on stackoverflow

I was wondering, could this and how would this be implemented using a segue from a button or other control? It seems that I'm not getting the following line to take effect with my segue:

$popover.popoverBackgroundViewClass=[CustomPopoverBackgroundView class];

because none of my custompopover.h or .m code loads or gets called. Anyone care to enlighten me as to what i've implemented poorly?

Also, I used a bit from this tutorial, but I still seem to miss how to properly implement this:

thinkvitamin tutorial post

Thanks for your attention!

Community
  • 1
  • 1
sethtc
  • 61
  • 3

1 Answers1

0

How about something like this?

- (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]; 
}