Skip to content

Instantly share code, notes, and snippets.

@EricADockery
Created February 10, 2018 15:41
Show Gist options
  • Save EricADockery/61a2229e3b8bc4ab187254d707542779 to your computer and use it in GitHub Desktop.
Save EricADockery/61a2229e3b8bc4ab187254d707542779 to your computer and use it in GitHub Desktop.
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