This is the workflow of my application: The user can select the default printer on the application settings page and will use this default printer to print directly each time without any preview dialog .
We can select a printer using UIPrinterPickerController
:
let printerPicker = UIPrinterPickerController(initiallySelectedPrinter: nil)
printerPicker.present(from: CGRect(x: 0, y: 0, width: 600, height: 500), in: self, animated: true) { (printerPicker, userDidSelect, error) in
if userDidSelect {
let defaultPrinter = printerPicker.selectedPrinter
}
}
Upon receipt, UIPrinter
we cannot directly store the object UIPrinter
in UserDefaults, which is not a type of support for UserDefault.
Are there other save options UIPrinter
in UserDefaults or any other way to keep the printer as default.
source
share