SLExpandableTableView
SLExpandableTableView copied to clipboard
Delegate method to control the animation of a cell after collapsing
I added this method to the delegate to control the animation, since if you closed a cell which was expanded at the bottom of the screen and still went outside the screen, the tableview would scroll all the way to the top.
I needed some time to think about this and I don't think a delegate method - (BOOL)tableView:(SLExpandableTableView *)tableView shouldAnimateScrollToSection:(NSUInteger)section;
is the appropriate pattern for this feature. How about a new enum property expandingSectionPosition
which lets you specify to open sections at SPLExpandingSectionPositionTop
, SPLExpandingSectionPositionBottom
or SPLExpandingSectionPositionUnspecified
with a default value of SPLExpandingSectionPositionTop
.
I have two big annoyances with auto scrolls. Does this pull request solve any of those?
- When expanding if the expanded rows are outside the screen the table should auto scroll
- When collapsing the current auto scroll that makes the header the first visible row of the table should be disabled. It's really annoying to the user