neoneye/SwiftyFORM

Explanation of validateAndUpdateUI() vs validate()

justdan0227 opened this issue · 3 comments

Can you provide an explanation of the two in the documentation? Thanks!

Invoking form_installSubmitButton() and a "Submit" button gets shown in the navigation bar. It shows an alert with validation status. The form_installSubmitButton() can used during development for validating the form.

When the form actually have to be submitted to a server or similar, then one will have to make a custom function for uploading to the server.

Oh I'm so sorry.. I didn't explain my question. I have a submit button that when pressed I call

formBuilder.validateAndUpdateUI()

let result = formBuilder.validate()

I check the result from formBuilder.validate(), but I"m not sure what formBuilder.validateAndUpdateUI() does (but saw it in your example code). I don't see those calls documented.

It seems to end up calling TextFieldCell.reloadPersistentValidationState. This function invalidates a timer and hides an eventual error message shown below the textfield.

Sorrry, I can't remember what I intended with validateAndUpdateUI.