dogo/SCLAlertView — pull request #9 by mamaral (2014-10-19 01:00:36+00:00)
Title: Add validation block

One of the common use-cases I think many could use the SCLAlertView for is a sign-up, login, or similar process. Such processes involve some sort of validation, and it would be nice to be able to validate the fields before the alert is dismissed, like if a required field was left blank. This pull request adds a new version of the addButton method that accepts a validation block. If this block returns YES, the actionBlock is executed and the alert is dismissed. If it returns NO the actionBlock is *not* executed and the actionBlock is not dismissed. Any handling of the failed validation case can be done by the developers inside the validation block prior to passing NO.