Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ profile

DerivedData/

.DS_Store

# CocoaPods
Pods/
Podfile.lock

25 changes: 23 additions & 2 deletions JMStatefulTableViewController/JMStatefulTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ @interface JMStatefulTableViewController ()
@property (nonatomic, assign) BOOL isCountingRows;
@property (nonatomic, assign) BOOL hasAddedPullToRefreshControl;

// Initialization

- (void) _setupStatefulTableViewController;

// Loading

- (void) _loadFirstPage;
Expand All @@ -50,15 +54,29 @@ - (id) initWithStyle:(UITableViewStyle)style {
self = [super initWithStyle:style];
if (!self) return nil;

_statefulState = JMStatefulTableViewControllerStateIdle;
self.statefulDelegate = self;
[self _setupStatefulTableViewController];

return self;
}

- (id) initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (!self) return nil;

[self _setupStatefulTableViewController];

return self;
}

- (void) dealloc {
self.statefulDelegate = nil;
}

- (void) _setupStatefulTableViewController {
_statefulState = JMStatefulTableViewControllerStateIdle;
_statefulDelegate = self;
}

#pragma mark - Loading Methods

- (void) loadNewer {
Expand Down Expand Up @@ -108,9 +126,12 @@ - (void) _loadNextPage {
} else {
self.statefulState = JMStatefulTableViewControllerStateEmpty;
}

[self.tableView.infiniteScrollingView stopAnimating];
} failure:^(NSError *error) {
//TODO What should we do here?
self.statefulState = JMStatefulTableViewControllerStateIdle;
[self.tableView.infiniteScrollingView stopAnimating];
}];
} else {
self.tableView.showsInfiniteScrolling = NO;
Expand Down
10 changes: 5 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

PODS:
COCOAPODS: 0.16.1

PODS:
- SVPullToRefresh (0.4.1)

DEPENDENCIES:
DEPENDENCIES:
- SVPullToRefresh (~> 0.4.1)

SPEC CHECKSUMS:
SPEC CHECKSUMS:
SVPullToRefresh: 61a0e4bd12bd6f8e3465909810b0fbeb1a28d5f2

COCOAPODS: 0.14.0