BeatsKitano / KafkaRefresh

Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.
MIT License
1.21k stars 142 forks source link

Disable footRefreshControl when no more data available #41

Closed jeromeDms closed 5 years ago

jeromeDms commented 5 years ago

Hi Thanks for this lib ! I want to disable the footRefreshControl if no more data are available.

if(no more data) [self.theTableView.footRefreshControl endRefreshingAndNoLongerRefreshingWithAlertText: nil];

The above works ONLY if footer was already refreshing because of

if((!self.isRefresh && !self.isAnimating) || self.isHidden) return;

In my case, during the first load (footer not triggered yet), I want to disable footRefreshControl because I already know there are no more data, how can I do ?

Thanks !

BeatsKitano commented 5 years ago

in this case, DO NOT call 'bindFootRefreshHandler' method when you know there are no more data, footer will not be added to tableview. Thanks!

jeromeDms commented 5 years ago

bindFootRefreshHandler is declared in the viewDidLoad. At that time I do not know yet if there will be more data available or not.

I'm now using .hidden property on footRefreshControl, this is not the cleanest solution but it works. That would be nice to have a public property 'enabled' :-)