xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.79k stars 1.33k forks source link

How to implement RuleRequired for custom row having multiple textfields #2096

Open reenaphilip opened 4 years ago

reenaphilip commented 4 years ago

I have created a custom row with cell having 3 textfields. Before submitting the form to server I should ensure all the three fields are filled by the user. How can I add Rule for this?

mats-claassen commented 4 years ago

RuleRequired checks whether the value is nil or an empty string (in case its type is String) For your custom value object I guess you will have to create a new Rule which checks that all three parts of your value are not empty. I am supposing that your value is some sort of Equatable object with three variables for those text fields?

reenaphilip commented 4 years ago

Yes its an object. Will check that with nil for all the three values.