Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLCollapsibleTableViewController #61

Open
Droppix opened this issue Nov 8, 2015 · 0 comments
Open

TLCollapsibleTableViewController #61

Droppix opened this issue Nov 8, 2015 · 0 comments

Comments

@Droppix
Copy link

Droppix commented Nov 8, 2015

Hi,

A small bug: If you have 0 rows in the section, the app crash.

Suggestion for correction:
In the file "UITableView+ScrollOptimizer.m":

  • (void)optimizeScrollPositionForSection:(NSInteger)section options:(TLTableViewScrollOptions)options topInset:(CGFloat)topInset animated:(BOOL)animated
    {
    NSIndexPath *firstIndexPath = [NSIndexPath indexPathForRow:0 inSection:section];
    NSInteger rows = [self.dataSource tableView:self numberOfRowsInSection:section];
    if (rows) rows --;
    NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:rows inSection:section];
    [self optimizeScrollPositionForIndexPaths:@[firstIndexPath, lastIndexPath] options:options topInset:topInset animated:animated];
    }

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant