I want to change view in my UIPopoverController.
I have :
if (popoverController == nil) {
UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
Help *d = [storyboard instantiateViewControllerWithIdentifier:@"Help"];
//Help *d = [[Help alloc]initWithNibName:@"Help" bundle:[NSBundle mainBundle]];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:d];
popover.delegate = self;
popoverController = popover;
}
CGRect popoverRect = [self.view convertRect:[helpBtn frame] fromView:[helpBtn superview]];
popoverRect.size.width = MIN(popoverRect.size.width, 100);
[popoverController presentPopoverFromRect:popoverRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
and it load first view, but on the first view I have button and whit it I want to change viewcontroller in storyboard.
But when I do that it opens new view as fullscreen view not as UIPopoverController.
Thanks for help
Marko
There are several solutions.
The better one is to have different views managed by your view controller rather than changing the view controller. It seems easier.
You could also wrap your view controller inside a navigation controller and then push and pop or present modally.
Finally, you could try to dismiss / destroy your popover and make a new one with the other view controller, but you would have to fiddle with the animations to make that look good.