TableViewDelegate
@objc(FWTableViewDelegate)
@objcMembers
open class TableViewDelegate : NSObject, UITableViewDataSource, UITableViewDelegate
便捷表格视图代理
-
表格数据,可选方式,必须按[section][row]二维数组格式
Declaration
Swift
open var tableData: [[Any]] -
表格section数,默认自动计算tableData
Declaration
Swift
open var countForSection: (() -> Int)? -
表格section数,默认0自动计算,优先级低
Declaration
Swift
open var sectionCount: Int -
表格row数句柄,默认自动计算tableData
Declaration
Swift
open var countForRow: ((Int) -> Int)? -
表格row数,默认0自动计算,优先级低
Declaration
Swift
open var rowCount: Int -
表格section头视图句柄,支持UIView或UITableViewHeaderFooterView,默认nil
Declaration
Swift
open var viewForHeader: ((Int) -> Any?)? -
表格section头视图,支持UIView或UITableViewHeaderFooterView,默认nil,优先级低
Declaration
Swift
open var headerViewClass: Any? -
表格section头视图配置句柄,参数为headerClass对象,默认为nil
Declaration
Swift
open var headerConfiguration: HeaderFooterViewSectionBlock? -
表格section头高度句柄,不指定时默认使用FWDynamicLayout自动计算并按section缓存
Declaration
Swift
open var heightForHeader: ((Int) -> CGFloat)? -
表格section头高度,默认nil自动根据viewModel计算,可设置为automaticDimension,优先级低
Declaration
Swift
open var headerHeight: CGFloat? -
表格section尾视图句柄,支持UIView或UITableViewHeaderFooterView,默认nil
Declaration
Swift
open var viewForFooter: ((Int) -> Any?)? -
表格section尾视图,支持UIView或UITableViewHeaderFooterView,默认nil,优先级低
Declaration
Swift
open var footerViewClass: Any? -
表格section头视图配置句柄,参数为headerClass对象,默认为nil
Declaration
Swift
open var footerConfiguration: HeaderFooterViewSectionBlock? -
表格section尾高度句柄,不指定时默认使用FWDynamicLayout自动计算并按section缓存
Declaration
Swift
open var heightForFooter: ((Int) -> CGFloat)? -
表格section尾高度,默认nil自动根据viewModel计算,可设置为automaticDimension,优先级低
Declaration
Swift
open var footerHeight: CGFloat? -
表格cell类句柄,style为default,支持cell或cellClass,默认nil
Declaration
Swift
open var cellForRow: ((IndexPath) -> Any?)? -
表格cell类,支持cell或cellClass,默认nil,优先级低
Declaration
Swift
open var cellClass: Any? -
表格cell配置句柄,参数为对应cellClass对象,默认设置fwViewModel为tableData对应数据
Declaration
Swift
open var cellConfiguation: CellIndexPathBlock? -
表格cell高度句柄,不指定时默认使用FWDynamicLayout自动计算并按indexPath缓存
Declaration
Swift
open var heightForRow: ((IndexPath) -> CGFloat)? -
表格cell高度,默认nil自动根据viewModel计算,可设置为automaticDimension,优先级低
Declaration
Swift
open var rowHeight: CGFloat? -
表格选中事件,默认nil
Declaration
Swift
open var didSelectRow: ((IndexPath) -> Void)? -
表格删除标题句柄,不为空才能删除,默认nil不能删除
Declaration
Swift
open var titleForDelete: ((IndexPath) -> String?)? -
表格删除标题,不为空才能删除,默认nil不能删除,优先级低
Declaration
Swift
open var deleteTitle: String? -
表格删除事件,默认nil
Declaration
Swift
open var didDeleteRow: ((IndexPath) -> Void)?
-
Undocumented
Declaration
Swift
open func numberOfSections(in tableView: UITableView) -> Int -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String? -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle -
Undocumented
Declaration
Swift
open func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)
TableViewDelegate Class Reference