Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.53k stars 1.1k forks source link

Improved the algorithm that calculates the number of skeleton lines for UITextViews #410

Closed Juanpe closed 3 years ago

Juanpe commented 3 years ago

Summary

The goal of this PR is to improve the algorithm that calculates the number of skeleton lines for UITextViews. Now, the library is using the same logic for UILabels and UITextViews. The library took the height of the view to calculate the height of each skeleton line. But this is not valid for UITextViews, because they have a height defined from the beginning and it's higher than the height of the line. So now the library takes into account the font line height and the height of the view defined by the constraints to calculate the final height.

Before fix

before_fix

After fix

after_fix

Requirements