tciuro/NoticeView — pull request #26 by blakewatters (2012-11-13 04:25:09+00:00)
Title: Refactor NoticeView for Simplicity & Extensibility, Add Podspec, and Improve Compatibility with Accessibility Labels (Testing)

Hi there -

I have recently been working with the NoticeView class because it provided such a nice drop-in solution for presenting nicely styled UIAlertView replacements. Thanks for providing such a nice implementation!

I've made several changes in my fork that I think may be of interest in the main distribution so I thought I'd bundle them up for sharing. I am happy to split these commits apart or make further changes to help in getting the changes merged upstream -- just let me know.

This pull request consists of 3 commits:

1. Adds a .podspec file to the repository. I installed via `:local` from a submodule, so I needed a Podspec. I recommend keeping one in the main repository.
1. Updated the internals of `WBNoticeView` to set up accessibility labels and attributes for the notice. I do extensive functional testing with KIF and these changes make it easy to target the notice views inside of tests.
1. The final commit is big and substantive. Today my designer delivered specifications for customizing the display of the notice views to better match our application. After diving into the implementation details of each notice, it became clear that it was going to be very difficult to customize the look and feel given the current structure of the notice classes. I spent several hours this evening refactoring things and I think its much cleaner and lends itself to better re-use. I may have further commits iterating on this tomorrow when I finish out the styling.

There's some breaking API changes in here, but I think its probably worth it and won't be very painful given the small footprint of the library.

There is one other change that I would propose making in the `WBNoticeView` interface: the names of the `delay` and `duration` properties were misleading to me and I had to refer back to the code several times today to keep them straight. I would propose renaming them to `animationDuration` and `timeoutInterval` to disambiguate the functionality.

Thanks again for the nice little library!