개발/swift

Swift validation

lemonade 2020. 10. 5. 22:31
반응형

Swift validation

 

Sometimes we want to validate forms with many fields, for example name, phone, email, and with different rules.

 

In swift, we can use predicate and extension.

 

Define your regular expression and predicate.

 

 

 

Next step, use predicate in extension.

 

 

Tada, you can call it everywhere.

반응형