Skip to content
rpinto edited this page Jul 24, 2015 · 2 revisions

MagicV2ViewController

MagicTableView is a group of classes used to simplify all processes linked to the UITableView when you develop a Database or API linked list.

It includes :

  • pull to refresh using a UIRefreshControl
  • paging using tableView:willDisplayCell:forRowAtIndexPath: and a customizable loading UITableViewCell
  • empty state using a customizable loading UITableViewCell
  • Data caching using data validity duration.
  • Support Detail / List mode with a specific request sent first (basically to request object detail like member Profile) then requesting a paginated list of object (for example user activity list).

How it works

It's based on the Model-View-Controller pattern.

First you need to create an UITableViewController inherited from the MagicV2ViewController.

Secondly you need to create an NSObject inherited from the MagicV2ListInteractor. It will retrieve datas to poppulate the list.

Optionally you can create an NSObject inherited from the MagicV2DetailInteractor. It will retrieve the UITableView header data and then ask the list to update.

Then refer to the MagicV2ViewController, MagicV2ListInteractor, MagicV2DetailInteractor page to implement the methods you need.

You can customise the empty page loader UITableViewCell, the paging UITableViewCell (last cell of the UITableView) and the "no data" UITableView from your MagicV2ViewController override.

Clone this wiki locally