Question

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
enter image description here

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.

Was it helpful?

Solution

Add the elements you want to your UIViewController *popoverViewController. this is the viewcontroller that is displayed in PopoverController * popoverController.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top