声明tableView
fileprivate var tableView : UITableView?;
fileprivate var _supportRefresh:Bool = true;
fileprivate var _supportLoadMore:Bool = true;
var sections : Array<TableSection>;
self.rowSelectedSignal = RACSubject();
初始化tableView
open func configure(_ tableView:UITableView)
{
self.tableView = tableView;
self.tableView?.dataSource = self;
self.tableView?.delegate = self;
}
// reload
open func reload()
{
self.tableView?.reloadData();
}
// indexPath对应的row
open func tableRowWithIndexPath(_ indexPath:IndexPath) -> TableRow
{
return self.sections[indexPath.section].rows[indexPath.row];
}
// 返回section
open func numberOfSections(in tableView: UITableView) -> Int {
return self.sections.count;
}
// 每个section中的行数
open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.sections[section].rows.count;
}
遍历
for c in 0...gridHeaders.count - 1 {
// do something
}
常亮定义
let navBarHeight:CGFloat = 45;
网友评论