RSDGenericStepObject

public struct RSDGenericStepObject : RSDGenericStep, Decodable

RSDGenericStepObject is a step with key/value pairs decoded from a dictionary. This is the default step returned by RSDFactory for an unrecoginized type.

This step is intended for use as a placeholder step for decoding a step that may be defined using a customized subtype or for replacing properties on an RSDMutableStep.

  • 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
  • The decoded dictionary.

    Declaration

    Swift

    public let userInfo: [String : Any]
  • Copy the step to a new instance with the given identifier, but otherwise, equal.

    Declaration

    Swift

    public func copy(with identifier: String) -> RSDGenericStepObject

    Parameters

    identifier

    The new identifier.

  • Initialize from a Decoder.

  • example:

       // Example JSON dictionary that includes two property keys for "title" and "text". These values
       // will be added to the `userInfo` dictionary.
       let json = """
         {
         "identifier": "step3",
         "title": "Step 3",
         "text": "Some text.",
         }
       """.data(using: .utf8)! // our data in native (JSON) format
    
  • Throws

    DecodingError

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to use to decode this instance.

  • Instantiate a step result that is appropriate for this step. Default implementation will return a RSDResultObject.

    Declaration

    Swift

    public func instantiateStepResult() -> RSDResult

    Return Value

    A result for this step.

  • Required method. This implementation has no validation.

    Declaration

    Swift

    public func validate() throws