RSDStandardAsyncActionConfiguration
public struct RSDStandardAsyncActionConfiguration : RSDRecorderConfiguration, Codable
RSDStandardAsyncActionConfiguration
is a concrete implementation of RSDRecorderConfiguration
that can be used to
decode an async configuration for a recorder.
Note
There is no implementations of the recorders included in this framework. That is to allow this framework to stand alone without requiring any embedded frameworks that may be unused by a given application. For example, there are numerous different uses for theCoreMotion
framework. One task module will use this framework
to gather background information about tremor, while another will use it to measure response time. Since
the use-case will differ with the task and when it is most appropriate to request permissions will differ
with the task, it is unnecessarily restrictive to enforce constraits generally. (syoung 11/20/2017)
-
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: RSDStandardPermissionType
-
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 at which to stop the action. If
nil
, then the action will be stopped when the task is stopped.Declaration
Swift
public var stopStepIdentifier: String?
-
List of the permissions required for this action.
Declaration
Swift
public var permissions: [RSDPermissionType]
-
Whether or not the recorder requires background audio.
Declaration
Swift
public var requiresBackgroundAudio: Bool
-
Default initializer.
Declaration
Swift
public init(identifier: String, type: RSDStandardPermissionType, startStepIdentifier: String?, stopStepIdentifier: String?)
Parameters
identifier
The identifier for this recorder.
type
The permission type associated with this recorder.
startStepIdentifier
The start step identifier (if any).
stopStepIdentifier
The stop step identifier (if any).
-
Validate the async action to check for any configuration that should throw an error. This method does nothing but is required by the
RSDAsyncActionConfiguration
protocol.Declaration
Swift
public func validate() throws