-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single field validation #35
base: master
Are you sure you want to change the base?
Single field validation #35
Conversation
I feel like this would limit the functionality of the library. Whether you pass in an array of Rules that is size 1 or 100 the library should work the exact same. Is there something particular about your use case that I am not understanding? |
What about passing a callback to 'validateField' rather than adding a method to the delegate? |
A callback sounds like a much better idea than the delegate method. As for the functionality, I'd like to be able to give the user feedback as soon as they start typing, and update that feedback as they type. I do not want to wait to give validation errors and feedback until the user presses submit. If I currently want to validate one field at a time, I need to unregister all the other fields. I am currently validating a field as soon as the user begins to type, and updating the style transform and error text whenever they type a character. Registering and unregistering fields every time the user switches fields seems less efficient if you don't want every field validating and showing errors at once. |
+1 |
I am sorry but I think I merged in an existing PR for this. I don't primarily program in Swift anymore and would like to see this library continue to be updated and developed. I have created in issue #81 If you are interested in contributing please talk with me in there. I won't be closing this PR because I am hopeful that someone will use this code in the future. |
This will allow the validation of only one of the registered fields. Can be used to update errors while a field is being edited or when a field resignsFirstResponder.