Closed mokagio closed 10 years ago
Hi, thanks for the pull request. I'm trying to keep this library as simple as possible, and I don't think the upside of removing a single alloc call is worth the downside of increasing the API. Most of Apple's newer APIs only have a single way to create an object, whereas the older APIs typically had several, mostly for different memory-management (retain vs. autoreleased constructors).
Cool, I see your point. Although my implementation moved the alloc
into alertViewWithTitle:message:style:cancelButtonTiltle:otherButtonTitles:tapBlock:
, making showAlertViewWithTitle:message:style:cancelButtonTiltle:otherButtonTitles:tapBlock:
calling it under the hood. There would still be only one real way to create an object, but yes the API would increase in size.
Cheers :beers:
The factory methods to build and show the configured
UIAlertView
in one shot are pretty handy. In some cases though I'd like to build the alert view but don't show it straightaway.I know that this is possible using the
initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:
method and setting thetapBlock
afterwards, but I like the simplicity of the factory method.