zenangst / Spots

:bamboo: Spots is a cross-platform view controller framework for building component-based UIs
Other
1.31k stars 72 forks source link

Refactor/component flow layout on tvos and ios #828

Closed zenangst closed 6 years ago

zenangst commented 6 years ago

This PR refactors the component flow layout implementations to remove the use of cachedFrames. It moves the layout calculation to layoutAttributesForItem instead of doing it post in layoutAttributesForElements. The algorithm for implementing multiple items per row has also been greatly improved and should be a lot more easy to maintain in the future.

codecov[bot] commented 6 years ago

Codecov Report

Merging #828 into master will decrease coverage by 7.94%. The diff coverage is 45.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #828      +/-   ##
==========================================
- Coverage   83.97%   76.03%   -7.95%     
==========================================
  Files         154      154              
  Lines       10546    10393     -153     
==========================================
- Hits         8856     7902     -954     
- Misses       1690     2491     +801
Flag Coverage Δ
#ios 58.09% <0%> (-24.7%) :arrow_down:
#osx 86.67% <ø> (ø) :arrow_up:
#tvos 73.87% <46.66%> (-8.08%) :arrow_down:
Impacted Files Coverage Δ
Sources/iOS+tvOS/Classes/ComponentTableView.swift 100% <ø> (ø)
Sources/Universal/Structs/Interaction.swift 93.75% <ø> (ø)
Sources/iOS+tvOS/Classes/CarouselSpotHeader.swift 0% <ø> (ø)
Sources/Universal/Classes/ViewPreparer.swift 64.7% <ø> (ø)
...OS+tvOS/Extensions/UITableView+UserInterface.swift 76.64% <ø> (ø)
Sources/iOS+tvOS/Classes/ScrollViewManager.swift 0% <ø> (ø)
...versal/Extensions/SpotsController+Extensions.swift 55% <ø> (ø)
.../iOS+tvOS/Extensions/Component+iOS+tvOS+List.swift 94.73% <ø> (ø)
...iversal/Extensions/CollectionView+Extensions.swift 100% <ø> (ø)
Sources/Universal/Structs/ComponentModel.swift 76.31% <ø> (ø)
... and 94 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc596bc...8cd9bbb. Read the comment docs.