How do I dismiss the AirPrint Popover?
Asked Answered
C

2

5

I have a singleton popover, so that I only show one popover at a time. When I do my share popover, and choose AirPrint, the share popover correctly goes away, showing the AirPrint popover in its place.

But if I press the share button again, the share popover displays on top of the AirPrint popover.

I can't find a way of referencing the AirPrint popover to dismiss it.

Some further information - I have UIBarButtonItems on a toolbar at the bottom of the screen, and four UIBarButtonItems nested inside a navigationBar's rightBarButtonItem at the top of the screen.

The UIBarButtonItems at the bottom of the screen correctly dismiss the AirPrint popover automatically, but the nested ones at the top do not.

But if I knew the name of the AirPrint popover, I could dismiss it from the top buttons' code.

Configuration answered 22/6, 2011 at 3:8 Comment(0)
T
5

The actual "AirPrint" UIPopoverController is not available to you. However, if you need to make it go away programmatically, you do:

[[UIPrintInteractionController sharedPrintController] dismissAnimated:YES];
Thermocline answered 13/8, 2011 at 0:40 Comment(0)
B
3

You should be able to dismiss Printer popover view as below code.

UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
[pic dismissAnimated:YES];
Buchholz answered 13/8, 2011 at 0:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.