I’ve created a subclass of UITextField that adds validation facilities and appearance feedback.
The idea is that users are happier when it is clear what is expected from them. If you have fields in a form, say, and some either NEED to be filled out or they NEED to be filled out in a specific way, the validating text field will indicate visually if the field has everything it needs.
Programmatically, it’s easy to set up. You either assign a block to the text field that returns a BOOL or implement the validation delegate protocol. The textfield will take care of its own appearance.
Get the code from here and I hope you find it useful!
Get a sample Xcode 5 project from here: https://dl.dropboxusercontent.com/u/3903183/TextFields.zip