Instance Method


Implemented to draw the view’s content for printing.


func draw(_ rect: CGRect, for formatter: UIViewPrintFormatter)



A rectangle that defines the area for drawing printable content.


An instance of UIViewPrintFormatter obtained by calling the viewPrintFormatter() method.


You implement this method if you want a view’s printed content to appear differently than its displayed content. If you add a view print formatter to a print job but do not implement this method, the view’s draw(_:) method is called to provide the content for printing.

For more information about how to implement a custom drawing routine for printed content, see Drawing and Printing Guide for iOS.

See Also

Formatting Printed View Content

func viewPrintFormatter() -> UIViewPrintFormatter

Returns a print formatter for the receiving view.