Skip to content

Conversation

@adam-felix-shopify
Copy link

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.

@adam-felix-shopify adam-felix-shopify marked this pull request as ready for review August 29, 2022 13:06
@adam-felix-shopify adam-felix-shopify changed the title Switch height to a function and not a variable. Switch height to a function and not a variable Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant