1
我试图运行关闭,但我收到一个错误。无法将类型'()'的值转换为结束结果类型'Bool'。我不确定我在这里做错了什么。快速关闭不起作用
func runPrintCycle(){
self.runPrinter1() { success in
self.runPrinter2() { success in
print("Success")
}
}
}
func runPrinter1(completionHandler: (Bool) -> Bool){
if let printer1 = Workstation.instance.printer1{
let receiptPrinter = Print(printer: printer1)
receiptPrinter.runPrinterReceiptSequence() { success in
completionHandler(true)
}
}else{
completionHandler(true)
}
}
func runPrinter2(completionHandler: (Bool) -> Bool){
if let printer2 = Workstation.instance.printer2{
let receiptPrinter = Print(printer: printer2)
receiptPrinter.runPrinterReceiptSequence() { success in
completionHandler(true)
}
}else{
completionHandler(true)
}
}