RSDOrderedStepNavigator

public protocol RSDOrderedStepNavigator : RSDStepNavigator, RSDStepValidator

Implementation of a step navigator that will apply conditions and navigation based on the steps, navigation rules, and conditional rules associated with this navigator.

  • step(with:) Extension method

    Returns the step associated with a given identifier.

    Declaration

    Swift

    public func step(with identifier: String) -> RSDStep?

    Parameters

    identifier

    The identifier for the step.

    Return Value

    The step with this identifier or nil if not found.

  • shouldExit(after:with:) Extension method

    Should the task exit early from the entire task?

    Declaration

    Swift

    public func shouldExit(after step: RSDStep?, with result: RSDTaskResult) -> Bool

    Parameters

    step

    The current step.

    result

    The current result set for this task.

    Return Value

    true if the task view controller should exit.

  • hasStep(after:with:) Extension method

    Given the current task result, is there a step after the current step?

    This method is checked when first displaying a step to determine if the UI should display this as the last step. By default, the UI defined in ResearchUI will change the text on the continue button from Next to Done, unless customized.

    Note

    the task result may or may not include a result for the given step.

    Declaration

    Swift

    public func hasStep(after step: RSDStep?, with result: RSDTaskResult) -> Bool

    Parameters

    step

    The current step.

    result

    The current result set for this task.

    Return Value

    true if the task view controller should show a next button.

  • hasStep(before:with:) Extension method

    Given the current task result, is there a step before the current step?

    This method is checked when first displaying a step to determine if the UI should display this as the first step. By default, the UI defined in ResearchUI will hide the Back button if there is no step before the given step.

    Note

    the task result may or may not include a result for the given step.

    Declaration

    Swift

    public func hasStep(before step: RSDStep, with result: RSDTaskResult) -> Bool

    Parameters

    step

    The current step.

    result

    The current result set for this task.

    Return Value

    true if the task view controller should show a back button.

  • step(after:with:) Extension method

    Return the step to go to after completing the given step.

    Declaration

    Swift

    public func step(after step: RSDStep?, with result: inout RSDTaskResult) -> (step: RSDStep?, direction: RSDStepDirection)

    Parameters

    step

    The previous step or nil if this is the first step.

    result

    The current result set for this task.

    Return Value

    The next step to display or nil if this is the end of the task.

  • step(before:with:) Extension method

    Return the step to go to before the given step.

    Declaration

    Swift

    public func step(before step: RSDStep, with result: inout RSDTaskResult) -> RSDStep?

    Parameters

    step

    The current step.

    result

    The current result set for this task.

    Return Value

    The previous step or nil if the task does not support backward navigation or this is the first step.

  • progress(for:with:) Extension method

    Return the progress through the task for a given step with the current result.

    Declaration

    Swift

    public func progress(for step: RSDStep, with result: RSDTaskResult?) -> (current: Int, total: Int, isEstimated: Bool)?

    Parameters

    step

    The current step.

    result

    The current result set for this task.

    Return Value

    • current: The current progress. This indicates progress within the task.
    • total: The total number of steps.
    • isEstimated: Whether or not the progress is an estimate (if the task has variable navigation).