Type Property

batteryLevelDidChangeNotification

Posted when the battery level changes.

Declaration

class let batteryLevelDidChangeNotification: NSNotification.Name

Discussion

For this notification to be sent, you must set the isBatteryMonitoringEnabled property to true.

Notifications for battery level change are sent no more frequently than once per minute. Do not attempt to calculate battery drainage rate or battery time remaining; drainage rate can change frequently depending on built-in applications as well as your application.

You can obtain the battery level by getting the value of the batteryLevel property.

See Also

Notifications

class let orientationDidChangeNotification: NSNotification.Name

Posted when the orientation of the device changes.

class let proximityStateDidChangeNotification: NSNotification.Name

Posted when the state of the proximity sensor changes.