MBBatteryState Class Reference

Inherits from NSObject
Declared in MBBatteryMonitor.h

Overview

When the MBBatteryMonitor service posts a MBBatteryMonitor:update event to the default NSNotificationCenter, the object of the NSNotification will contain an MBBatteryState object describing the state of the battery.

  isPluggedIn

YES if the device is currently plugged in to wall power.

@property (nonatomic, readonly) BOOL isPluggedIn

Declared In

MBBatteryMonitor.h

  isCharging

YES if the device is currently plugged in and charging.

@property (nonatomic, readonly) BOOL isCharging

Declared In

MBBatteryMonitor.h

  isFullyCharged

YES if the device is currently plugged in and fully charged.

@property (nonatomic, readonly) BOOL isFullyCharged

Declared In

MBBatteryMonitor.h

  isDraining

YES if the device is currently unplugged and draining the battery.

@property (nonatomic, readonly) BOOL isDraining

Declared In

MBBatteryMonitor.h

  batteryLevel

A number between 0.0 and 1.0 (inclusive) indicating the percent of battery charge remaining. A value of 0.0 indicates that the device has no battery charge remaining, while 1.0 indicates that the battery is fully charged.

@property (nonatomic, readonly) float batteryLevel

Declared In

MBBatteryMonitor.h