Latest 1.0.0
Homepage https://github.com/zhuyunfeng1224/XHArrayDataSource
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation
Authors

a datasource for tableview and collectionView
一个简单datasource,解决每次都要实现UITableViewDataSource/UICollectionViewDataSource的困扰

使用方法

两句话实现dataSource,注意由于tableView.dataSource是weak的,不要直接用初始化语句赋值,并且dataSource一定要是实例变量

self.dataSource = [[XHArrayDataSource alloc] initWithItems:array cellIdentifier:@"Cell" configureCellBlock:^(UITableViewCell *cell, NSString *item) {
  cell.textLabel.text = item;
}];
self.tableView.dataSource = _dataSource;

UICollectionView同理

导入

手工导入

直接下载或者clone,将pod->Development Pods->XHArrayDataSource->XHArrayDataSource->classes
XHArrayDataSource.h和XHArrayDataSource.m引入工程即可

cocoapods

pod 'XHArrayDataSource', '~> 1.0.0'

License

MIT license.

Latest podspec

{
    "name": "XHArrayDataSource",
    "version": "1.0.0",
    "summary": "A dataSource of UITableView and UICollectionView.",
    "description": "TODO: A dataSource of UITableView and UICollectionView. You needn't impletation UITableViewDataSource or UICollectionViewDataSource.",
    "homepage": "https://github.com/zhuyunfeng1224/XHArrayDataSource",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "echo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhuyunfeng1224/XHArrayDataSource.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "XHArrayDataSource/Classes/**/*",
    "frameworks": [
        "UIKit",
        "Foundation"
    ]
}

Pin It on Pinterest

Share This