Class

UIPrinterPickerController

The system interface for selecting a printer.

Overview

You can use a printer picker controller to display a list of printers to the user prior to printing a document, photo, or other content. Printer pickers display all pickers normally but you can filter out printers by assigning an appropriate delegate object to the picker before displaying it.

A printer picker controller coordinates the presentation and dismissal of its interface with its associated delegate object. The delegate object is an object that you provide and that conforms to the UIPrinterPickerControllerDelegate protocol. When the user selects a printer, the picker also notifies the delegate of the selection.

A printer picker controller is not a view controller, so you do not present it the way you do other view controllers. You present the picker using one of the presentation methods of this class. Those methods work with the picker’s delegate object to determine the most appropriate way to present the picker. If the delegate implements the printerPickerControllerParentViewController(_:) method, the picker presents itself using the view controller returned by that method. Some presentation methods may present the picker using a popover instead.

For more information about the picker delegate methods, see UIPrinterPickerControllerDelegate.

Topics

Creating a Picker Controller Object

init(initiallySelectedPrinter: UIPrinter?)

Creates and returns a printer picker with an initially selected printer object.

Accessing the Picker Delegate

var delegate: UIPrinterPickerControllerDelegate?

The delegate for the printer picker controller.

Presenting and Dismissing the Picker

func present(from: UIBarButtonItem, animated: Bool, completionHandler: UIPrinterPickerCompletionHandler? = nil)

Present the picker in a popover that is anchored to the specified bar button item.

func present(from: CGRect, in: UIView, animated: Bool, completionHandler: UIPrinterPickerCompletionHandler? = nil)

Present the picker in a popover that is anchored to a rectangle in the specified view.

func dismiss(animated: Bool)

Dismiss the picker.

Getting the Selected Printer

var selectedPrinter: UIPrinter?

The selected printer.

Constants

typealias UIPrinterPickerCompletionHandler

The completion handler to execute when dismissing a printer picker controller.

Relationships

Inherits From

Conforms To

See Also

Printer Picker

protocol UIPrinterPickerControllerDelegate

A set of methods for managing the presentation and dismissal of a printer picker interface.