SKBatteryData Class Reference

Inherits from SKSensorData : NSObject
Declared in SKBatteryData.h

Overview

An instance of SKBatteryData encapsulates measurements related to the Battery sensor.

– initWithSensorType:withTimestamp:

Returns an SKSensorData object, initialized with the given SKSensorType and SKSensorTimestamp.

- (instancetype)initWithSensorType:(SKSensorType)sensorType withTimestamp:(SKSensorTimestamp *)timestamp

Parameters

sensorType

The type of the sensor that produced this data object.

timestamp

The time were this data log was captured.

Return Value

A new SKSensorData object.

Declared In

SKSensorData.h

– initWithLevel:withState:

Returns an SKBatteryData object, initialized with measurements of the battery level, as well as the battery state.

- (instancetype)initWithLevel:(CGFloat)level withState:(UIDeviceBatteryState)state

Parameters

level

A float number that indicates the current battery charge level. Value ranges from 0.0 (fully discharged) to 1.0 (fully charged).

state

An enumerator that descrives the state of the battery, classified as Charging, Full, Unplugged or Unknown.

Return Value

An SKBatteryData object.

Declared In

SKBatteryData.h

  level

A float number that indicates the current battery charge level. Value ranges from 0.0 (fully discharged) to 1.0 (fully charged).

@property (nonatomic, readonly) CGFloat level

Declared In

SKBatteryData.h

  state

An enumerator that describes the state of the battery, classified as Charging, Full, Unplugged or Unknown.

@property (nonatomic, readonly) UIDeviceBatteryState state

Declared In

SKBatteryData.h

  stateString

A string value that describes the state of the battery, classified as Charging, Full, Unplugged or Unknown.

@property (nonatomic, readonly, copy) NSString *stateString

Declared In

SKBatteryData.h

+ csvHeader

A string with a CSV formatted header that describes the data of the Battery sensor. This method is useful in combination with the csvString instance method of an SKSensorData object.

+ (NSString *)csvHeader

Return Value

A string with a CSV header.

Declared In

SKBatteryData.h