murraymurraymurray murraymurraymurray - 1 month ago 20
Swift Question

How many maximum printings can UIPrintInteractionController (Swift) execute?

How many maximum printings can UIPrintInteractionController (Swift) execute?

I'm currently doing AirPrint for a project.
Wondering how to do stress tests of printing in bulk in use of Printer Simulator.

  • Is there a delegate of something like

  • How to debug a number of
    printing waiting in queue

  • Is there any way to customise the alert view of printing?



From the documentation :

1- var printingItems: [Any]? { get set } Takes an array of printing-ready objects ( NSURL, NSData, UIImage, or ALAsset). The documentation doesn't cite any limit so we assume the limit would be the value of unsigned int in your architecture.

2- There are 2 delegate methods for the beginning and end of printing : Start and End of a Print Job

func printInteractionControllerWillStartJob(UIPrintInteractionController)
//Tells the delegate that the print job is about to start.
func printInteractionControllerDidFinishJob(UIPrintInteractionController)
//Tells the delegate that the print job has ended.

You can use those to get the IsPrinting status. (between first and second).

3- The documentation doesn't offer any delegate method to get the waiting in queue

4- You can customise the alert using :

printInfo UIPrintInfo: The aforementioned print job configuration.
printPaper UIPrintPaper: A simple type that describes the physical and printable size of a paper type; except for specialized applications, this will be handled for you by UIKit.
showsNumberOfCopies Bool: When true, lets the user choose the number of copies.
showsPageRange Bool: When true, lets the user choose a sub-range from the printed material. This only makes sense with multi-page content—it’s turned off by default for images.
showsPaperSelectionForLoadedPapers Bool: When this is true and the selected printer has multiple paper options, the UI will let the user choose which paper to print on.

For some detailed explanation about printing using Swift, please refer to the following link: UIPrint​Interaction​Controller - Written by Nate Cook

If this response was helpful and has what you needed, please don't forget to validate it :).

Good luck with your app.