UIPrintInteractionController printer response

I'm currently using UIPrintInteractionController to print an image to an airprinter and it works no problem. The issue is with the callback from the printer about the job itself. It seems that the completion handler from the methods UIPrintInteractionController.shared.present or UIPrintInteractionController.shared.printTo both only return if the job was successfully sent to the printer, not if the print job succeeded. For example, right now my printer is out of ink and the job fails, but when I call printTo it returns immediately with success but later I get a system popup that the print job failed because the printer is out of ink.


My question is how can I determine if the print job succeed on the printer, is there a system notificaiton or something I am unaware of?


Thanks in advance for your help.


Relevant code:


let printAttempt = UIPrintInteractionController.shared.print(to: selectedPrinter) { (interactionController, completed, error) in
                if let nsError = error as NSError?, nsError.domain == UIPrintErrorDomain {
                    var reason: String
                    switch nsError.code {
                    case UIPrintingNotAvailableError:       reason = NSLocalizedString("printing_error_not_available", comment: "Not Available")
                    case UIPrintNoContentError:             reason = NSLocalizedString("printing_error_no_content", comment: "No Content")
                    case UIPrintUnknownImageFormatError:    reason = NSLocalizedString("printing_error_image_format", comment: "Image Format")
                    case UIPrintJobFailedError:             reason = NSLocalizedString("printing_error_job_failed", comment: "Job Failed")
                    default:
                        if let localizedDesc = error?.localizedDescription {
                            reason = localizedDesc
                        } else {
                            reason = NSLocalizedString("printing_error", comment: "Generic error")
                        }
                    }
                    DLog("Error on print attempt \(reason)")
                    callback?(PrintResult.error(reason: reason))
                } else if completed == false {
                    let reason = error?.localizedDescription ?? NSLocalizedString("printing_error", comment: "Generic error")
                    DLog("Error on print attempt \(reason)")
                    callback?(PrintResult.error(reason: reason))
                } else {
                    DLog("Successful print attempt")
                    callback?(PrintResult.success(printer: selectedPrinter))
                }
            }

            if printAttempt == false {
                DLog("Error on print attempt")
                callback?(PrintResult.error(reason: NSLocalizedString("printing_error", comment: "Generic error")))
            }