In my app, I have a button, when it is clicked a popoverView will be displayed.
I used the following code
First, I added UIPopover+Iphone.h and UIPopover+Iphone.m files from the link Popover view for iPhone using XCode 5
-(IBAction)buttonClicked:(id)sender
{
UIViewController *popoverViewController=[[UIViewController alloc]init];
UIPopoverController * popoverController=[[UIPopoverController alloc]initWithContentViewController:popoverViewController];
popoverController.popoverContentSize=CGSizeMake(200, 200);
[popoverController presentPopoverFromRect:timingTextField.frame inView:self.view permittedArrowDirections: UIPopoverArrowDirectionUp animated:YES];
}
I got an output like this
Now I want to insert some objects in it, say a button or some other equivalent UI element. Can anyone please suggest me something. Thanks in advance.
Add the elements you want to your
UIViewController *popoverViewController
. this is theviewcontroller
that is displayed inPopoverController * popoverController
.