Latest 0.0.3
Homepage https://github.com/QiuZhiFei/ZFListView
License MIT
Platforms ios 8.0, requires ARC
Authors
let tableView = UITableView(frame: .zero, style: .plain)
// 拆分刷新
let refresh = ZFListViewRefreshNormal(tableView)
// 拆分网络加载
let client = ZFHomeClient()

listView = ZFListView(frame: .zero, refresh: refresh, client: client)

// 配置刷新
listView.configure(topRefreshEnabled: true)
listView.configure(moreRefreshEnabled: true)

// 配置UI
listView.tableView.delegate = dataSource
listView.tableView.dataSource = dataSource
listView.tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellReuseIdentifier)

listView.listChangedHandler = {
[weak self] (items) in
guard let `self` = self else { return }
self.dataSource.configure(list: items)
self.listView.tableView.reloadData()
}
dataSource.heightForRowHandler = {
[weak self] (tableView, indexPath) in
guard let _ = self else { return 0 }
return 44
}
dataSource.cellForRowHandler = {
(tableView, indexPath, data) in
let cell = tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier, for: indexPath)
cell.textLabel?.text = data
return cell
}
dataSource.didSelectRowHandler = {
(tableView, indexPath, data) in
debugPrint("did select (data ?? "data")")
}

Latest podspec

{
    "name": "ZFListView",
    "version": "0.0.3",
    "summary": "u7b80u6d01u7684 listView",
    "description": "u7b80u4ecbu3001u5206u79bbu7684 listView",
    "homepage": "https://github.com/QiuZhiFei/ZFListView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "zhifei": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/QiuZhiFei/ZFListView.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "Classes",
        "Core/*.{swift}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This