Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 846 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 846 Bytes

ArrayDataSource

Implementation of a generic UITableViewDataSource that can be used to reduce the amount of code in UIViewControllers.

Inspired by the great article lighter-view-controllers

How to install it?

Just drag and drop the ROArrayDataSource folder on your project or use cocoapods

How to use it?

Just set an instance of ROArrayDataSource as the dataSource of the table view.

- (void)setupTableViewDataSource
{
    self.dataSource = [[ROArrayDataSource alloc] initWithItems:self.data cellIdentifier:cellIdentifier configureCellBlock:^(CustomCell *cell, NSObject *object) {
        cell.label.text = [object description];
    }];
    self.tableView.dataSource = self.dataSource;
}