ORKDeviceMotionRecorder Class Reference
Inherits from | ORKRecorder : NSObject |
---|---|
Declared in | ORKDeviceMotionRecorder.h ORKDeviceMotionRecorder.m |
Overview
The ORKDeviceMotionRecorder
class represents a recorder that requests and collects device motion data from CoreMotion at a fixed frequency.
To ensure that the motion recorder continues to record when the app enters the
background, use the background task support provided by UIApplication
.
Other Methods
frequency
The frequency of motion data collection from CoreMotion in hertz (Hz).
@property (nonatomic, readonly) double frequency
Declared In
ORKDeviceMotionRecorder.h
– initWithIdentifier:frequency:step:outputDirectory:
Returns an initialized device motion recorder using the specified frequency.
- (instancetype)initWithIdentifier:(NSString *)identifier frequency:(double)frequency step:(nullable ORKStep *)step outputDirectory:(nullable NSURL *)outputDirectory
Parameters
identifier |
The unique identifier of the recorder (assigned by the recorder configuration). |
---|---|
frequency |
The frequency of motion data collection from CoreMotion in hertz (Hz). |
step |
The step that requested this recorder. |
outputDirectory |
The directory in which the device motion data should be stored. |
Return Value
An initialized motion data recorder.
Declared In
ORKDeviceMotionRecorder.h
Other Methods
– stop
Stops data recording, which generally triggers the return of results.
- (void)stop
Discussion
If an error occurs when stopping the recorder, it is returned through the delegate.
Subclasses should call finishRecordingWithError:
rather than calling super.
Declared In
ORKRecorder.h
– isRecording
A Boolean value indicating whether the recorder is currently recording.
- (BOOL)isRecording
Return Value
YES
if the recorder is recording; otherwise, NO
.
Declared In
ORKRecorder.h