Doc
Install
In order to test the printing system from the iOS Simulator is required to install the ‘Printer Simulator’. This app is included inside Additional Tools for Xcode 9 (inside folder Hardware) in Developer Downloads
Usage
To print for iPhone/iPad is necesary to obtain the shared instance of UIPrintInteractionController y configure it. To do that, you must create an instance of UIPrintInfo an set all the necessary values as:
- Work name to identify it in the print queue
- Orientation
- Type of impression: text, image, other.
- The content to print, in one of the follogin formats:
- NSData, NSURL, UIImage, o ALAsset
- Array of NSData, NSURL, UIImage, or ALAsset
- UIPrintFormatter (this allows to define the layout)
- UIPrintPageRenderer
Last, you must to present the controller in the screen using some method like presentFromBarButtonItem.