If this is an iPad app, you need to use the UIPopoverController. This is a pop-up “window” that contains a view and is associated with an area on the screen, such as a button on a toolbar or a rectangle (for example, a UIButton frame).
To use this, create a new instance of the UIPopoverController using the constructor that takes the UIViewController and pass in the view you want to show.
Due to garbage collection considerations, make sure you store the UIPopoverController in the class property.
You might also want to clear this property when the popover is closed. To support this, we subclassed the UIPopoverController, added an event that could be hooked up by the caller, then redefined the Dismiss method and fired the associated event, if any, in the redefined method.
Once you create a popover instance, you will want to show it. You can do this using one of the PresentFromxxx methods. If you represent this using a button (not a toolbar), you can call PresentFromRect using the button frame as a rectangle.
The presented view can control its size by setting the ContentSizeForViewInPopover property in the ViewDidLoad method.
source share