luisrecuenco / LRScrollingSidebarController

A scrolling based sidebar controller
MIT License
171 stars 15 forks source link

scrollsToTop Support For UITableViews #10

Open insanj opened 10 years ago

insanj commented 10 years ago

Is there any way to allow for scrollsToTop when using a UITableView inside of the scrolling sidebar controller? Since this property is irrelevant to this library, it would be great to have it available for subviews.

luisrecuenco commented 10 years ago

Hey @insanj. Sorry for the late reply.

It's as simple as overriding - (void)controllerIsVisible:(BOOL)controllerIsVisible and setting the proper scrollsToTop property. So, let's imagine you have one tableView in each of the three child controllers. In that case, you should do the following:

#pragma mark - ISThreePanelProtocol

- (void)controllerIsVisible:(BOOL)controllerIsVisible
{
    self.tableView.scrollsToTop = controllerIsVisible;
}

Let me know if that works.

holbalzs commented 7 years ago

Hy @luisrecuenco i had same problem this is solved thank you. But if i change main controller, the scroll to top won't work again. In Main controller also has got controllerIsVisible. I manually change to false before replace main controller.