-
Notifications
You must be signed in to change notification settings - Fork 0
MagicViewController
MagicViewController is a subclass of UIViewController. It's the main class of the MagicTableView.
- override the
initMagicModelmethods and init and set the Magic Model :
- (void)initMagicModel
{
YourMagicModel* lMagicModel = [[YourMagicModel alloc] init];
self.mModel = lMagicModel;
[lMagicModel release];
}-
override the
tableView:cellForRowAtIndexPath:methods to create your own cell. -
override the
tableView:heightForRowAtIndexPath:methods to set your cells height. -
in your view controller .xib, add a UITableView, override its class to MagicTableView. Link the reference outlet to your view controller
mTableViewvariable. Link your view controller as the UITableViewDelegate and the UITableViewDataSource.
-
override the
initMagicPullToRefreshViewmethods to set your own pull to refresh view or change the defaultMagicPullToRefreshViewframe. -
override the
initDefaultPagingTableFooterViewmethods to set your own paging table footer view. -
override the
initDefaultLoadingViewmethods to set your own loading view displayed when no data are available. -
override the
MagicTableViewEmptyStateView:methods and return your custom empty view. Called when a the model finish loading with no results received.
-
When the
viewWillAppear:method is called, it init the MagicModel and the MagicPullToRefreshView. -
By default the MagicViewController handle the
tableView:numberOfRowsInSection:method by returning the number of objects contained into the MagicModel results. -
If you override the
scrollViewDidScroll:or thescrollViewDidEndDragging:, don't forget to call the MagicViewController methods.