RSDCollectionResult

public protocol RSDCollectionResult : RSDAnswerResultFinder, RSDResult

RSDCollectionResult is used include multiple results associated with a single step or async action that may have more that one result.

  • The list of input results associated with this step. These are generally assumed to be answers to field inputs, but they are not required to implement the RSDAnswerResult protocol.

    Declaration

    Swift

    var inputResults: [RSDResult] { get set }
  • findResult(with:) Extension method

    Find a result within this collection.

    Declaration

    Swift

    public func findResult(with identifier: String) -> RSDResult?

    Parameters

    identifier

    The identifier associated with the result.

    Return Value

    The result or nil if not found.

  • findAnswerResult(with:) Extension method

    Find an answer result within this collection. This method will return nil if there is a result but that result does not conform to to the RSDAnswerResult protocol.

    Declaration

    Swift

    public func findAnswerResult(with identifier: String) -> RSDAnswerResult?

    Parameters

    identifier

    The identifier associated with the result.

    Return Value

    The result or nil if not found.

  • answers() Extension method

    Return a mapping of all the RSDAnswerResult objects in this collection as a mapping of the identifier to the value.

    Declaration

    Swift

    public func answers() -> [String : Any]
  • appendInputResults(with:) Extension method

    Append the result to the end of the input results, replacing the previous instance with the same identifier.

    Declaration

    Swift

    @discardableResult
    mutating public func appendInputResults(with result: RSDResult) -> RSDResult?

    Parameters

    result

    The result to add to the input results.

    Return Value

    The previous result or nil if there wasn’t one.

  • removeInputResult(with:) Extension method

    Remove the result with the given identifier.

    Declaration

    Swift

    @discardableResult
    mutating public func removeInputResult(with identifier: String) -> RSDResult?

    Parameters

    result

    The result to remove from the input results.

    Return Value

    The previous result or nil if there wasn’t one.