Skip to content
Browse files

adding method for updating infinite scrolling handler and footer view

  • Loading branch information...
1 parent 20052bc commit d5b5af3ee98f276dc321a2cea053a1a04edb8230 Conlan Rios committed
View
2 JMStatefulTableViewController/JMStatefulTableViewController.h
@@ -63,4 +63,6 @@ typedef enum {
- (void) loadNewer;
+- (void) updateInfiniteScrollingHandlerAndFooterView:(BOOL)shouldInfinitelyScroll;
+
@end
View
14 JMStatefulTableViewController/JMStatefulTableViewController.m
@@ -323,8 +323,18 @@ - (void) viewWillAppear:(BOOL)animated {
shouldInfinitelyScroll = [self.statefulDelegate statefulTableViewControllerShouldInfinitelyScroll:self];
}
+ [self updateInfiniteScrollingHandlerAndFooterView:shouldInfinitelyScroll];
+
+ [self _loadFirstPage];
+
+ [super viewWillAppear:animated];
+}
+
+- (void) updateInfiniteScrollingHandlerAndFooterView:(BOOL)shouldInfinitelyScroll {
if (shouldInfinitelyScroll) {
if(self.tableView.infiniteScrollingView.infiniteScrollingActionHandler == nil) {
+ __block JMStatefulTableViewController *safeSelf = self;
+
[self.tableView addInfiniteScrollingWithActionHandler:^{
[safeSelf _loadNextPage];
}];
@@ -333,10 +343,6 @@ - (void) viewWillAppear:(BOOL)animated {
self.tableView.infiniteScrollingView.infiniteScrollingActionHandler = nil;
self.tableView.tableFooterView = nil;
}
-
- [self _loadFirstPage];
-
- [super viewWillAppear:animated];
}
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

0 comments on commit d5b5af3

Please sign in to comment.
Something went wrong with that request. Please try again.