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.
-
An ordered list of steps to run for this task.
Declaration
Swift
var steps: [RSDStep] { get }
-
A list of step markers to use for calculating progress. If defined, progress is calculated counting only those steps that are included in the progress markers rather than inspecting the step array.
Declaration
Swift
var progressMarkers: [String]? { get }
-
A list of the tracking rules that apply to this navigator.
Declaration
Swift
var trackingRules: [RSDTrackingRule] { get }
-
The navigation rule (if any) associated with this step.
Declaration
Swift
func navigationRule(for step: RSDStep) -> RSDNavigationRule?
-
The navigation skip rule (if any) associated with this step.
Declaration
Swift
func navigationSkipRule(for step: RSDStep) -> RSDNavigationSkipRule?
-
The navigation back rule (if any) associated with this step.
Declaration
Swift
func navigationBackRule(for step: RSDStep) -> RSDNavigationBackRule?
-
step(with:)
Extension methodReturns 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 methodShould 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 methodGiven 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
toDone
, 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 methodGiven 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 methodReturn 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 methodReturn 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 methodReturn 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).