RSDDistanceRecorderConfiguration

@available(iOS 10.0, *)
public struct RSDDistanceRecorderConfiguration : RSDRecorderConfiguration, Codable

The default configuration to use for a RSDDistanceRecorder.

  • example:
    // Example json for a codable configuration.
       let json = """
            {
               "identifier": "foo",
               "type": "distance",
               "motionStepIdentifier": "run"
               "startStepIdentifier": "countdown",
               "stopStepIdentifier": "rest",
           }
           """.data(using: .utf8)! // our data in native (JSON) format
  • A short string that uniquely identifies the asynchronous action within the task. If started asynchronously, then the identifier maps to a result stored in RSDTaskResult.asyncResults.

    Declaration

    Swift

    public let identifier: String
  • The standard permission type associated with this configuration.

    Declaration

    Swift

    public let type: RSDAsyncActionType
  • Identifier for the step that records distance travelled. The recorder uses this step to record distance travelled while the other steps in the task are assumed to be standing still.

    Declaration

    Swift

    public let motionStepIdentifier: String
  • An identifier marking the step to start the action. If nil, then the action will be started when the task is started.

    Declaration

    Swift

    public let startStepIdentifier: String?
  • An identifier marking the step to stop the action. If nil, then the action will be started when the task is started.

    Declaration

    Swift

    public let stopStepIdentifier: String?
  • Set the flag to true to encode the samples as a CSV file.

    Declaration

    Swift

    public var usesCSVEncoding: Bool?
  • Default initializer.

    Declaration

    Swift

    public init(identifier: String, motionStepIdentifier: String, startStepIdentifier: String? = nil, stopStepIdentifier: String? = nil)

    Parameters

    identifier

    The configuration identifier.

    motionStepIdentifier

    Optional identifier for the step that records distance travelled.

    startStepIdentifier

    An identifier marking the step to start the action. Default = nil.

    stopStepIdentifier

    An identifier marking the step to stop the action. Default = nil.

  • Returns location and motion on iOS. Returns an empty set on platforms that do not support distance recording.

    Declaration

    Swift

    public var permissionTypes: [RSDPermissionType] { get }
  • Returns true. Background audio is required for this configuration.

    Declaration

    Swift

    public var requiresBackgroundAudio: Bool { get }
  • Do nothing. No validation is required for this recorder.

    Declaration

    Swift

    public func validate() throws