#import <EMInfiniteScrollController.h>
Inherits UIViewController, and <EMPageableDataSourceDelegate>.
Inherited by EMProductReviewsController, and EMSearchQueryInfiniteScrollController.
Public Member Functions | |
| (id) | - initWithDataSource:maxItems: |
| (void) | - loadMoreObjects |
| (void) | - reloadTableData |
| (UITableViewCell *) | - tableView:cellForRowAtIndexPath:withObject: |
| (UITableViewCell *) | - tableView:loadingCellForRowAtIndexPath: |
| (NSInteger) | - numberOfHeaderRowsForTableView: |
| (UITableViewCell *) | - tableView:headerCellForRowAtIndexPath:withObject: |
| (UIViewController *) | - detailControllerForObject: |
Static Public Member Functions | |
| (id) | + controllerWithDataSource:maxItems: |
Protected Attributes | |
| UITableView * | _tableView |
| NSInteger | _maxItems |
| NSInteger | _pageSize |
| NSInteger | _preloadOffset |
| id< EMPageableDataSource > | _objectSource |
| BOOL | _showItems |
| NSError * | _error |
Properties | |
| UITableView * | tableView |
| NSInteger | maxItems |
| NSInteger | pageSize |
| NSInteger | preloadOffset |
| id< EMPageableDataSource > | objectSource |
For analytic compatability, child classes overwriting -viewWillAppear: and -viewWillDisappear should remember to call super.
| - (UIViewController *) detailControllerForObject: | (id) | object |
If the subclass does not implement this or returns nil, The infinite scroll controller does not do anything when a cell is selected. Otherwise, it pushes this controller onto the stack.
| - (void) reloadTableData |
Call this instead of [self.tableView reloadData];
| - (UITableViewCell *) tableView: | (UITableView *) | tableView | |
| cellForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
| withObject: | (id) | object | |
To be overridden by subclasses
| - (UITableViewCell *) tableView: | (UITableView *) | tableView | |
| loadingCellForRowAtIndexPath: | (NSIndexPath *) | indexPath | |
Reasonable default
- (BOOL) _showItems [protected] |
It is sometimes desired to not show any items, like For search controllers when there are no search terms / empty search query
- (NSInteger) maxItems [read, write, assign] |
Can be used to limit the number of items, even if the datasource contains more than the maxItems
- (NSInteger) pageSize [read, write, assign] |
This sets the number of objects to load at a time. Defaults to 10. However, the first page of records is loaded by object source, so the first page of results is configured elsewhere
- (NSInteger) preloadOffset [read, write, assign] |
The infinite scroller will start loading the next page at when the table view loads the cell at this offset from the last cell. Defaults to 0.
1.8.0