kolinkrewinkel/KKGridView — pull request #127 by zadr (2012-04-04 03:13:01+00:00)
Title: More changes! (features + performance + general improvements)

This change set is rather big, and I'll be happy to break it up into a few smaller pull requests if desired. I *think* I managed to avoid using any tabs, so, the formatting should be good. And, of course, everything works fine in my testing, however, no one's perfect, and I may have missed things.

(Specifically: I do not have multiple selection enabled, and do my own custom highlighting/selection states in KKGridViewCell subclasses, so bugs may lie there.).

Anyway, please do let me know if there's anything else that needs changing.

##### New
KKGridView
- Add ability for rows to have backgrounds that take up the width of the tableview

##### Misc changes:
KKGridViewSectionInfo
- Use @compatibility_alias instead of a set of empty subclasses for KKGridView{Footer, Header}

KKGridView
- How cell selection/highlight takes place, to avoid selection on the Press -> Scroll -> Release flow
- Avoid drawing a cell on half-pixel points
- Use KVO instead of UIScrollViewDelegate methods
- Only layout cells when the cell size/padding is set and changed, not every time it is set

##### Performance-related changes:
KKGridView
- Cache -indexPathForIndex:0 inSection:0, since this is used a lot
- Don't remove cells from the gridview; its faster to set them hidden and alpha to 0.

KKGridViewCell
- Don't make _selectedBackgroundView or _contentView until it is first accessed by its getter (speeds up init)
- Don't remove cells from the gridview; its faster to set them hidden and alpha to 0.

KKGridViewUpdateStack
- Don't sort the update stack every time an item is added (allows for faster batching in addUpdates:)
- Use a dictionary lookup for most operations, instead of iterating through an array over and over