How to open the second UIPopOverController on the first click

Is it possible to open another uipopovercontroller from the first click of a UIButton? If so, how can I do this?

right now i am using this code to open popover from UIBarButtonItem

optionsViewController = [[OptionsViewController alloc] init];

popOverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];

popOverController.popoverContentSize = CGSizeMake(250, 300);
[popOverController presentPopoverFromBarButtonItem:bbiOpenPopOver permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
+3
source share
1 answer

You can open a second popover from any control in a popover; the mechanism is exactly the same as the opening of the first. You need a link to the content presentation controller, you create a new UIPopoverController with [[UIPopoverController alloc] initWithContentViewController:content];, you set any properties you want, and then present them.

To represent it from a UIButton or other control that does not use a UIBarButtonItem,

[popoverController presentPopoverFromRect:[control bounds] inView:control permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
+5
source

Source: https://habr.com/ru/post/1790516/


All Articles