Instance Method

presentFromBarButtonItem:animated:completionHandler:

Presents the iPad printing user interface in a popover view that can be animated from a bar-button item.

Declaration

- (BOOL)presentFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated completionHandler:(UIPrintInteractionCompletionHandler)completion;

Parameters

item

The UIBarButtonItem object that the user tapped for printing. You are encouraged to use the constant UIBarButtonSystemItemAction when creating a bar-button item for this purpose.

animated

YES to animate the printing popover view from item, NO to display it immediately.

completion

A block of type UIPrintInteractionCompletionHandler that you implement to handle the conclusion of the print job (for instance, to reset state) and to handle any errors encountered in printing.

Discussion

It is valid to call this method for applications on iPad devices. Calling this method on an iPhone or iPod touch with animated set to YES causes the printing options view to animate upward from the bottom of the screen.

If you call this method when the printing options are already displayed, UIPrintInteractionController hides the printing-options popover view. You must call the method again to display the options.

See Also

Presenting the Printing User Interface

- presentAnimated:completionHandler:

Presents the iPhone printing user interface in a sheet that can be animated to slide up from the bottom of the screen.

- presentFromRect:inView:animated:completionHandler:

Presents the iPad printing user interface in a popover view that can be animated from any area in a view.

- dismissAnimated:

Dismisses the printing-options sheet or popover.