MyFormworks / Formworks

Formworks is a framework for building forms from JSON files.
https://myformworks.github.io/Formworks/
MIT License
6 stars 1 forks source link

Initialising form cells from ViewModel #51

Closed Galdineris closed 4 years ago

Galdineris commented 4 years ago

A flaw in our architecture results in our components not working properly due to architecture. We need to avoid bulk initialisation of components.

csfar commented 4 years ago

We need to create an array of ViewModels, each representing the content and type of a Component, to be utilised in the initialisation process of a UICollectionViewCell. Each Component's ViewModel will be stored as part of an array in the Form ViewModel for easier response composition. The validation of each field will be done through a validator located inside each Component's ViewModel. Furthermore, each Component's ViewModel must have a property containing its formatted data to be used in the Form's response to the developer.