Instance Property

isBatteryMonitoringEnabled

A Boolean value indicating whether battery monitoring is enabled (true) or not (false).

Declaration

var isBatteryMonitoringEnabled: Bool { get set }

Discussion

Enable battery monitoring if your app needs to be notified of changes to the battery state, or if you want to check the battery charge level.

The default value of this property is false, which:

  • Disables the posting of battery-related notifications

  • Disables the ability to read battery charge level and battery state

See Also

Getting the Device Battery State

var batteryLevel: Float

The battery charge level for the device.

var batteryState: UIDeviceBatteryState

The battery state for the device.