Rely on original delegate for section row, delegate, and footer heights #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR attempts to provide the functionality required on issue #424 here
The approach was to delegate on the original table view delegate's implementation of the
heightForXXX
andestimatedHeightForXXX
family of methods.The main issue faced is that given that those methods are
optional
s on the Objc protocol, then the return types aren't optional.I was about to return
UITableView.automaticDimension
, which works similarly, but reading this piece of doc, it states that the value returned byheightForRow
takes precedence over the propertyrowHeight
. Following that logic, and to avoid breaking any current implementations, i delegated on the tableView'sXXXheight
andestimatedXXXHeight
and properties, which i'm assuming (and please correct me if i'm wrong) are either properly set by users to the expected height orautomaticDimension
Videos
Different-heights-example.mp4
Default-heights-example.mp4
Steps to reproduce
Added on the iOS example:
ViewController > SkeletonTableViewDelegate
And to test the different heights you can use any set of hardcoded values, including
automaticDimension
Requirements (place an
x
in each of the[ ]
)