Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 11. Implementing Multiple Scenes an... > Multiple Popovers in a Single Dismis...

Multiple Popovers in a Single Dismiss Method

When working with an application that can benefit from popovers, it isn’t unusual to define two or more different popover view controllers that are used in different situations. Unfortunately, this leads to a bit of a conundrum in handling the popovers in the dismissal method: How do we know which popover has been dismissed?

The answer is to check to see what class the contentViewController property references. For example, if I wanted to check to see whether the contentViewController for the popover that is being dismissed is an instance of EditorViewController, I could write the following:

if ([popoverController.contentViewController
     isMemberOfClass:[EditorViewController class]]) {
    // Do something specific for this type of popover
}


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint