PurchaseForm
public struct PurchaseForm
A series of grouped questions and answers to those questions
-
The groups of questions
Declaration
Swift
public let questionGroups: [QuestionGroup] -
Adds the supplied answer to the
PurchaseForm. If the question had already been answered this will replace the answer with the new one.answer: The
Answerto add
Throws
PurchaseFormError.invalidQuestionif theQuestionthe suppliedAnsweranswers did not belong to the formDeclaration
Swift
public mutating func addAnswer(_ answer: Answer) throws -
Validates all answers in the form, using their respective
QuestionsValidationRuleDeclaration
Swift
public func validate() -> [PurchaseFormError]Return Value
An
Array<PurchaseFormError>representing all the validation errors inside the form
PurchaseForm Structure Reference