present(from:animated:completionHandler:)
Presents the iPad printing user interface in a popover view, optionally animating it from a bar-button item.
Declaration
func present(from item: UIBarButtonItem, animated: Bool, completionHandler completion: UIPrintInteractionController.CompletionHandler? = nil) -> BoolParameters
- item:
The Uibarbuttonitem object that the user tapped for printing. You are encouraged to use the constant Action when creating a bar-button item for this purpose.
- animated:
True to animate the printing popover view from
item, False to display it immediately. - completion:
A block of type Completionhandler 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 true 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.