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 methodFind 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 methodFind an answer result within this collection. This method will return
nil
if there is a result but that result does not conform to to theRSDAnswerResult
protocol.Seealso
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 methodReturn 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 methodAppend the result to the end of the input results, replacing the previous instance with the same identifier.
Declaration
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 methodRemove 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.