ryanmaxwell / UIAlertView-Blocks

Category on UIAlertView to use inline block callbacks instead of delegate callbacks.
MIT License
425 stars 58 forks source link

Add a convenience method for an OK alert #16

Closed ghost closed 9 years ago

ghost commented 9 years ago

Add a class method to implement a basic 1-button alert that executes a completion block after the user taps the OK button.

ryanmaxwell commented 9 years ago

Hi @cmaynard - thanks for the PR - however I don't think this is appropriate for the core pod and something best left into your individual projects. I don't want to assume english localizations for developers or users - and this won't work well when strings are extracted into .strings files.

ghost commented 9 years ago

Sounds like your objection is to the use of the literal string "OK". I still think this category could use a convenience method like this. If you agree, I could add a button title parameter and submit another PR.

ryanmaxwell commented 9 years ago

@cmaynard I just don't really see the utility of broadening the API for a single use case - that can be achieved with no fewer method calls (just empty arguments). If you have a lot of single-button alerts within an app, it makes sense to achieve this with your own utility class (or category) that extends this with your own language (OK/Done/Dismiss/localized string etc) on the cancel button title.