Created
February 10, 2018 15:41
-
-
Save EricADockery/61a2229e3b8bc4ab187254d707542779 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
private override init() { | |
super.init() | |
manager = EAAccessoryManager.shared() | |
findConnectedPrinter { [weak self] bool in | |
if let strongSelf = self { | |
strongSelf.isConnected = bool | |
} | |
} | |
//Notifications | |
disconnectNotificationObserver = NotificationCenter.default.addObserver(forName: Notification.Name.EAAccessoryDidDisconnect, object: nil, queue: nil, using: didDisconnect) | |
connectedNotificationObserver = NotificationCenter.default.addObserver(forName: Notification.Name.EAAccessoryDidConnect, object: nil, queue: nil, using: didConnect) | |
manager.registerForLocalNotifications() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment