Skip to content

Add validation block#9

Merged
dogo merged 7 commits into
dogo:masterfrom
mamaral:add-validation-block
Oct 19, 2014
Merged

Add validation block#9
dogo merged 7 commits into
dogo:masterfrom
mamaral:add-validation-block

Conversation

@mamaral

@mamaral mamaral commented Oct 19, 2014

Copy link
Copy Markdown

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, and prevent the alert from being dismissed in this case. 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 alert is not dismissed. Any handling of the failed validation case can be done by the developers inside the validation block prior to passing NO.

@dogo

dogo commented Oct 19, 2014

Copy link
Copy Markdown
Owner

Pretty cool feature

dogo added a commit that referenced this pull request Oct 19, 2014
@dogo dogo merged commit 1a067ee into dogo:master Oct 19, 2014
@mamaral mamaral deleted the add-validation-block branch June 1, 2015 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants