Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding method for updating infinite scrolling handler and footer view

  • Loading branch information...
commit d5b5af3ee98f276dc321a2cea053a1a04edb8230 1 parent 20052bc
Conlan Rios authored
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 {
Please sign in to comment.
Something went wrong with that request. Please try again.