Created
February 10, 2018 15:42
-
-
Save EricADockery/c5fb87b90a7d032b167eb9d9751a9ddb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class ViewController: UIViewController { | |
@IBOutlet var printerConnectionStatus: UILabel! | |
var printManager = PrintManager.sharedInstance | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
printManager.connectionDelegate = self | |
if printManager.isConnected { | |
printerConnectionStatus.text = “Connected” | |
} else { | |
printerConnectionStatus.text = “Not Connected” | |
} | |
} | |
@IBAction func printTestLabel(_ sender: Any) { | |
printManager.printBarcode(for: “This is a test”) | |
} | |
} | |
extension ViewController: EAAccessoryManagerConnectionStatusDelegate { | |
func changeLabelStatus() { | |
if printManager.isConnected { | |
printerConnectionStatus.text = “Connected” | |
} else { | |
printerConnectionStatus.text = “Not Connected” | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment