These changes allow for header and footer width to be passed to the functional table data.
More specifically, FunctionalTableData.Delegate's UITableViewDelegate implemenation now
uses tableView's width in tableView(_:heightForHeaderInSection:) and tableView(_:heightForFooterInSection).
We achieved this functionality while maintaining backwards compatibility by adding a
protocol method to both TableHeaderFooterConfigType and TableHeaderFooterStateType called
func height(given width: CGFloat) -> CGFloat?. If this method returns nil, then
the table view delegate methods will use the current height property already defined, otherwise
it will use the provided by the new methods.
Each protocol provides a public default implemenation so that library consumers
need not implement this method unnecessarily.
These changes allow for header and footer width to be passed to the functional table data. More specifically,
FunctionalTableData.Delegate
'sUITableViewDelegate
implemenation now usestableView
's width intableView(_:heightForHeaderInSection:)
andtableView(_:heightForFooterInSection)
.We achieved this functionality while maintaining backwards compatibility by adding a protocol method to both
TableHeaderFooterConfigType
andTableHeaderFooterStateType
calledfunc height(given width: CGFloat) -> CGFloat?
. If this method returnsnil
, then the table view delegate methods will use the currentheight
property already defined, otherwise it will use the provided by the new methods.Each protocol provides a public default implemenation so that library consumers need not implement this method unnecessarily.