Latest 0.0.1
Homepage https://github.com/nghialv/TVDataSource
License MIT
Platforms ios 5.0, requires ARC
Authors

This class will help you implement TableView faster.

Instalation

TADataSource can be installed via CocoaPods.

  pod 'TVArrayDataSource'

or simply download and import TVArrayDataSource.h, TVArrayDataSource.m in your project manually.

Usage

configure datasource by using block

  // create block
  TVCellConfigureBlock configureCell = ^(TVCellByXib *cell, NSString *name) {
    [cell.title setText:name];
  };

  self.dataSource = [[TVArrayDataSource alloc] initWithItems:items
                                              cellIdentifier:@"MYCELL"
                                          cellConfigureBlock:configureCell];
  [self.dataSource setXibFileName:@"TVSimpleCell"];
  tableView.dataSource = self.dataSource;

or by selector

  // create datasource and set selector
  self.dataSource = [[TVArrayDataSource alloc] initWithItems:items
                                              cellIdentifier:@"MYCELL"
                                                      target:self
                                            cellConfigureSel:@selector(configureCell:andItem:)];
  [self.dataSource setCellClassName:@"TVCellByCode"];
  -(void)configureCell:(UITableViewCell *)cell andItem:(NSString *)item
  {
    [cell.textLabel setText:item];
  }

Latest podspec

{
    "name": "TVArrayDataSource",
    "version": "0.0.1",
    "summary": "This class will help you implement TableView faster.",
    "homepage": "https://github.com/nghialv/TVDataSource",
    "license": "MIT",
    "authors": {
        "nghialv": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nghialv/TVDataSource.git",
        "tag": "0.0.1"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source_files": [
        "TVArrayDataSource.h",
        "TVArrayDataSource.m"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This