How do you add an observer in Swift to the default notification center? I\'m trying to port this line of code that sends a notification when the battery level changes.
Swift 5 & Xcode 10.2:
NotificationCenter.default.addObserver( self, selector: #selector(batteryLevelDidChangeNotification), name: UIDevice.batteryLevelDidChangeNotification, object: nil)