Structures
The following structures are available globally.
-
A
RSDMotionRecord
is aCodable
implementation ofRSDSampleRecord
that can be used to record a sample from one of the core motion sensors or calculated vectors of theCMDeviceMotion
data object.- example:
// Example json for a codable record. func testMotionRecord_Attitude() { let json = """ { "timestamp" : 1.2498140833340585, "stepPath" : "Cardio Stair Step/heartRate.after/heartRate", "sensorType" : "attitude", "referenceCoordinate" : "North-West-Up", "heading" : 270.25, "eventAccuracy" : 4, "x" : 0.064788818359375, "y" : -0.1324615478515625, "z" : -0.9501953125, "w" : 1 } """.data(using: .utf8)! // our data in native (JSON) format
Seealso
CodableMotionRecorderTests.swift
unit tests for additional examples.Declaration
Swift
public struct RSDMotionRecord : RSDSampleRecord, RSDDelimiterSeparatedEncodable