RSDTaskObject
public class RSDTaskObject : RSDUIActionHandlerObject, RSDTask, Decodable
RSDTaskObject is the interface for running a task. It includes information about how to calculate progress,
validation, and the order of display for the steps.
-
A short string that uniquely identifies the task.
Declaration
Swift
public let identifier: String -
Information about the task.
Declaration
Swift
public var taskInfo: RSDTaskInfoStep? -
Information about the result schema.
Declaration
Swift
public var schemaInfo: RSDSchemaInfo? -
The step navigator for this task.
Declaration
Swift
public let stepNavigator: RSDStepNavigator -
A list of asynchronous actions to run on the task.
Declaration
Swift
public let asyncActions: [RSDAsyncActionConfiguration]? -
Default initializer.
Declaration
Swift
public init(taskInfo: RSDTaskInfoStep, stepNavigator: RSDStepNavigator, schemaInfo: RSDSchemaInfo? = nil, asyncActions: [RSDAsyncActionConfiguration]? = nil)Parameters
taskInfoAdditional information about the task.
stepNavigatorThe step navigator for this task.
schemaInfoInformation about the result schema.
asyncActionsA list of asynchronous actions to run on the task.
-
Initialize from a
Decoder.example:
let json = """ { "identifier" : "foo", "schemaInfo" : { "identifier" : "foo.1.2", "revision" : 3 }, "steps": [ { "identifier": "step1", "type": "instruction", "title": "Step 1" }, { "identifier": "step2", "type": "instruction", "title": "Step 2" }, ] "asyncActions" : [ { "identifier" : "location", "type" : "location" } ] } """.data(using: .utf8)! // our data in native (JSON) formatThrows
DecodingErrorif there is a decoding error.Declaration
Swift
public required init(from decoder: Decoder) throwsParameters
decoderThe decoder to use to decode this instance.
-
Instantiate a task result that is appropriate for this task.
Declaration
Swift
public func instantiateTaskResult() -> RSDTaskResultReturn Value
A task result for this task.
-
Validate the task to check for any model configuration that should throw an error.
Throws
An error appropriate to the failed validation.Declaration
Swift
public func validate() throws
View on GitHub
RSDTaskObject Class Reference