FWFormViewModel
final class FWFormViewModel
A representation of the FWForm
‘s ViewModel
.
-
Responsible for providing a communication between the
FWFormViewModel
and itsView
.Declaration
Swift
weak var delegate: FWFormViewModelDelegate
-
Initializes a new instance of this type.
Declaration
Swift
init(configuration: FWConfiguration)
Parameters
configuration
The configuration used to create a form.
-
The form’s title.
Declaration
Swift
var title: String
-
The number of components on the form.
Declaration
Swift
var numberOfComponents: Int { get }
-
The form’s color style.
Declaration
Swift
var style: FWStyle
-
Returns the component’s
ViewModel
for the given index.Declaration
Swift
func viewModelAt(index: IndexPath) -> FWComponentViewModel
-
Submits answers if every component is valid.
Declaration
Swift
func submit() -> Result<FWFormSnapshot, Error>
-
Sets the form up using the
FWConfiguration
passed as a paremeter in theFWFormViewModel
init.Declaration
Swift
func setUp()