I'm using carthage build from master branch, and when trying to add this rule to the row, it shows follow error
Incorrect argument label in call (have 'rule:', expected 'ruleSet:')
<<< IntRow("cvv") { row in
row.title = "Verification Code"
row.placeholder = "CVV"
row.add(rule: RuleRequired())
row.add(rule: RuleMinLength(minLength: 3))
}
And everything is fine in any other row
Using Xcode 8.1
Hey @dev4dev
RuleMinLength can only be used for String values. In your case you have a Int value so you should use RuleGreaterOrEqualThan(100)
CVVs can begin with "0", this rule will invalidate 1/10 from all card owners :)
In that case I would recommend you to use a TextRow then set up the keyboard to show only numeric digits and finally use RuleMinLength rule. It will work since TextRow holds a String value.
Alternatively you can use https://github.com/EurekaCommunity/CreditCardRow which is a custom row to enter credit cards.
@mspasov yep, that's why I switched back to TextRow =)
Most helpful comment
Hey @dev4dev
RuleMinLengthcan only be used for String values. In your case you have a Int value so you should useRuleGreaterOrEqualThan(100)