I wish to print paperwork utilizing UIPrintIntrectionController() and must cross one of many out there printer however i’ve to cross the printer programmatically as an alternative of hardcoding the main points of printer
i attempted utilizing NetServiceBrower() however it’s depreceted and assets usually are not out there about it
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "printing"
printInfo.outputType = UIPrintInfo.OutputType.normal
printController.printInfo = printInfo
let str = "hi there"
let dataStr: Knowledge = Knowledge(str.utf8)
let knowledge = NSData(knowledge: dataStr)
printController.printingItem = knowledge
//must entry a printer to cross to printerController
let printer = ??
printController.print(to: printer)