Ruby on Rails Validations in Objective-C
I’ve uploaded my MMValidation project to Github. It’s an easy way to get Rails-style validations on any subclass of NSObject.
You declare validations like this:
+(void)initialize {
[Person validatesPresenceOf:@"firstName"];
[Person validatesPresenceOf:@"lastName"];
}
And check them like this:
if ([myObject valid]) {
// yay! proceed as planned
} else {
// handle the validation errors
}
Click here to get it. Hope you enjoy!
nice and easy. good work
nice! that looks really awesome