Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch height to a function and not a variable #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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