Recipe: Basic Popovers

At the time of this writing, popovers remain an iPad-only feature. That may change as Apple introduces new iOS models or ports some of this functionality to the iPhone family of devices. Often you’ll want to present information using a popover as an alternative to presenting a modal view. There are several basic rules of popovers that you need to incorporate into your day-to-day development:

Image Always hang onto your popovers. Create strong local variables that retain your popovers until they are no longer needed. In Recipe 3-5, the variable is reset when the popover is dismissed.

Always check for existing popovers and dismiss ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.