RSDConditionalStepNavigatorObject

public struct RSDConditionalStepNavigatorObject : RSDConditionalStepNavigator, RSDCopyStepNavigator, Decodable

RSDConditionalStepNavigatorObject is a concrete implementation of the RSDConditionalStepNavigator protocol.

  • An ordered list of steps to run for this task.

    Declaration

    Swift

    public let steps: [RSDStep]
  • A list of step markers to use for calculating progress.

    Declaration

    Swift

    public var progressMarkers: [String]?
  • The identifier of the step after which any sections or subtasks should be inserted.

    Declaration

    Swift

    public var insertAfterIdentifier: String?
  • Default initializer.

    Declaration

    Swift

    public init(with steps: [RSDStep])

    Parameters

    steps

    An ordered list of steps to run for this task.

  • Return a copy of the step navigator that includes the desired section inserted in a position that is appropriate to this navigator.

    Declaration

    Swift

    public func copyAndInsert(_ section: RSDSectionStep) -> RSDConditionalStepNavigatorObject
  • Return a copy of the step navigator that includes the desired subtask inserted in a position that is appropriate to this navigator.

    Declaration

    Swift

    public func copyAndInsert(_ subtask: RSDTaskInfoStep) -> RSDConditionalStepNavigatorObject
  • Declaration

    Swift

    public func copyAndRemove(_ stepIdentifiers: [String]) -> RSDConditionalStepNavigatorObject
  • Find the index of the step with the given identifier.

    Declaration

    Swift

    public func index(of identifier: String?) -> Int?
  • Initialize from a Decoder. This decoding method will use the RSDFactory instance associated with the decoder to decode the steps and the conditionalRule.

  • example:

        let json = """
           {
               "progressMarkers": ["step1", "step2", "step3"],
               "steps": [
                          { "identifier" : "step1",
                            "type" : "instruction",
                            "title" : "Step 1" },
                          { "identifier" : "step2",
                            "type" : "instruction",
                            "title" : "Step 2" },
                          { "identifier" : "step2b",
                            "type" : "instruction",
                            "title" : "Step 2b" },
                          { "identifier" : "step3",
                            "type" : "instruction",
                            "title" : "Step 3" }
                        ],
               "conditionalRule" : {"type" : "medicationTracker"}
           }
           """.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.