RSDSurveyNavigationStep

public protocol RSDSurveyNavigationStep : RSDNavigationRule

RSDSurveyNavigationStep evaluates RSDSurveyRule objects that are associated with each input field to determine if the step navigation should skip to another step.

  • Identifier to skip to if all input fields have nil answers.

    Declaration

    Swift

    var skipToIfNil: String? { get }
  • The input fields to test as a part of this navigation.

    Declaration

    Swift

    var inputFields: [RSDInputField] { get }
  • Evaluate the survey rules for the given task result and return the next identifier.

    This method inspects all the survey rules and will return a value under the following conditions:

  • If all the results are nil and isPeeking equals false, then it will return the value of skipToIfNil
  • If one and only one skip identifier is returned by the evaluated survey rules.

    Note

    RSDSurveyNavigationStep extends RSDNavigationRule but does not implement the nextStepIdentifier() method because that will allow for additional customization by the step that is implementing this protocol.

    Seealso

    RSDFormUIStepObject for an example implementation.
  • result: The task result to evaluate.
  • isPeeking: Is this navigation rule being called on a result for a step that is navigating forward or is it a step navigator that is peeking at the next step to set up UI display? If peeking at the next step then this parameter will be true.

Declaration

Swift

public func evaluateSurveyRules(with result: RSDTaskResult?, isPeeking: Bool) -> String?

Parameters

result

The task result to evaluate.

isPeeking

Is this navigation rule being called on a result for a step that is navigating forward or is it a step navigator that is peeking at the next step to set up UI display? If peeking at the next step then this parameter will be true.

Return Value

The identifier for the step to skip to if the rules are true.