Created
February 10, 2018 15:42
-
-
Save EricADockery/9ef1da7ad60c98550be40fb4020b8130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func findConnectedPrinter(completion: (Bool) -> Void) { | |
let connectedDevices = manager.connectedAccessories | |
for device in connectedDevices { | |
if device.protocolStrings.contains(“com.zebra.rawport”) { | |
serialNumber = device.serialNumber | |
connectToPrinter(completion: { completed in | |
completion(completed) | |
}) | |
} | |
} | |
} | |
private func connectToPrinter( completion: (Bool) -> Void) { | |
printerConnection = MfiBtPrinterConnection(serialNumber: serialNumber) | |
printerConnection?.open() | |
completion(true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment