RSDSectionStepObject
public struct RSDSectionStepObject: RSDSectionStep, RSDStepValidator, Decodable
RSDSectionStepObject is used to define a logical subgrouping of steps such as a section in a longer survey or an active
step that includes an instruction step, countdown step, and activity step.
-
A short string that uniquely identifies the step within the task. The identifier is reproduced in the results of a step history.
Declaration
Swift
public let identifier: String -
The type of the step.
Declaration
Swift
public let stepType: RSDStepType -
A list of the steps used to define this subgrouping of steps.
Declaration
Swift
public let steps: [RSDStep] -
A list of step markers to use for calculating progress.
Declaration
Swift
public var progressMarkers: [String]? -
A list of asynchronous actions to run on the task.
Declaration
Swift
public var asyncActions: [RSDAsyncActionConfiguration]? -
Default initializer.
Declaration
Swift
public init(identifier: String, steps: [RSDStep], type: RSDStepType? = nil)Parameters
identifierA short string that uniquely identifies the step.
stepsThe steps included in this section.
typeThe type of the step. Default =
RSDStepType.section -
Instantiate a step result that is appropriate for this step. The default for this struct is a
RSDTaskResultObject.Declaration
Swift
public func instantiateStepResult() -> RSDResultReturn Value
A result for this step.
-
Validate the steps in this section. The steps are valid if their identifiers are unique and if each step is valid.
Declaration
Swift
public func validate() throws -
Initialize from a
Decoder. This implementation will query theRSDFactoryattached to the decoder for the appropriate implementation for each step in the array.example:
// Example JSON dictionary that includes two instruction steps. let json = """ { "identifier": "foobar", "type": "section", "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
DecodingErrorDeclaration
Swift
public init(from decoder: Decoder) throwsParameters
decoderThe decoder to use to decode this instance.
-
Required implementation for
RSDTask. This method always returnsnil.Declaration
Swift
public func action(for actionType: RSDUIActionType, on step: RSDStep) -> RSDUIAction? -
Required implementation for
RSDTask. This method always returnsnil.Declaration
Swift
public func shouldHideAction(for actionType: RSDUIActionType, on step: RSDStep) -> Bool?
View on GitHub
RSDSectionStepObject Structure Reference