i want to show popoverview with UIBarButtonItem action but i cannot add popover segue in storyboard. Because i added UIBarButtonItem programmatically.
Thanks in replies.
@property (nonatomic, strong) UIPopoverController *yourPopOverController;
In your action Method.
UIBarButtonItem *yourButton = (UIBarButtonItem *)sender;
YourViewController *yourViewControllerObject = [[YourViewController alloc]init];
yourPopOverController = [[UIPopoverController alloc] initWithContentViewController:yourViewControllerObject];
yourPopOverController.delegate = self;
[yourPopOverController presentPopoverFromBarButtonItem:yourButton permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.