I could find some code for skipping the Printing UI and direct print through the Air Printer.But the code was incomplete. The code is below,
UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:self.savedPrinter];
[printPicker presentAnimated:YES completionHandler:
^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error) {
if (userDidSelect) {
self.savedPrinter = printerPicker.selectedPrinter;
}
}];
In this code, self.savedPrinter mentioned. But how can i get the saved printer here. Please give me a complete answer or sample solution for this.
I got the solution for the question,which i asked above.Here is the solution,
First of all, you have to set the UIPrinterPickerController delegate; ie UIPrinterPickerControllerDelegate in your class.The next step is select the printer from the UIPrinterPickerController. So you have to add some code in your method.Here I am using button action in my settings viewcontroller.
If you want to set print functionality in any other view,You have to store the printer URL details and fetch the printer object from the stored url, in other views.
Now you can tell your UIPrintInteractionController to print directly by calling printToPrinter(:completionHandler:) with the saved printer instead of using one of the present methods.You can call the method in your button action.
I think, this is help your needs.