doc
 All Classes Functions Variables Properties
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
EMInfiniteScrollController Class Reference

#import <EMInfiniteScrollController.h>

Inherits UIViewController, and <EMPageableDataSourceDelegate>.

Inherited by EMProductReviewsController, and EMSearchQueryInfiniteScrollController.

List of all members.

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< EMPageableDataSourceobjectSource

Detailed Description

For analytic compatability, child classes overwriting -viewWillAppear: and -viewWillDisappear should remember to call super.


Member Function Documentation

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


Member Data Documentation

- (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


Property Documentation

- (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.


The documentation for this class was generated from the following files: