Instance Method

presentAnimated:completionHandler:

Presents the picker from a view controller of your app.

Declaration

- (BOOL)presentAnimated:(BOOL)animated completionHandler:(UIPrinterPickerCompletionHandler)completion;

Parameters

animated

YES to animate the display of the picker or NO to display it without animations.

completion

A block to execute when the picker is dismissed. Use this block to receive information about the selected printer or information about any errors that occurred.

Return Value

YES if the picker was displayed or NO if the picker was already visible.

Discussion

This method presents the picker from one of your app’s view controllers and returns immediately. If you provide a delegate object and that object implements the printerPickerControllerParentViewController: method, UIKit uses the view controller you provide to present the picker. If you do not provide a delegate, or your delegate object does not implement the printerPickerControllerParentViewController: method, UIKit presents the picker from the root view controller of your app’s main window.

After presenting the picker, the picker interface runs until the user or your app dismisses it. The picker interface provides ways for the user to cancel printing directly, all of which dismiss the picker. You can also dismiss the printer picker programmatically by calling the dismissAnimated: method.

See Also

Presenting and Dismissing the Picker

- presentFromBarButtonItem:animated:completionHandler:

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

- presentFromRect:inView:animated:completionHandler:

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

- dismissAnimated:

Dismiss the picker.