zenangst / Spots

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

Fixes delegates getting lost when replacing components #817

Closed zenangst closed 6 years ago

zenangst commented 6 years ago

When a controller replaces components, the component delegate is not set which means that the header wont get configured correctly. This PR fixes that issue by setting the delegate to the component during setupComponent and invoking afterUpdate after the component has been replaced which causes the component to reload headers and footers

codecov[bot] commented 6 years ago

Codecov Report

Merging #817 into master will decrease coverage by 0.78%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #817      +/-   ##
==========================================
- Coverage   84.81%   84.03%   -0.79%     
==========================================
  Files         152      152              
  Lines       10540    10542       +2     
==========================================
- Hits         8940     8859      -81     
- Misses       1600     1683      +83
Flag Coverage Δ
#ios 82.86% <100%> (ø) :arrow_up:
#osx 86.67% <100%> (ø) :arrow_up:
#tvos 82.02% <100%> (+8.23%) :arrow_up:
Impacted Files Coverage Δ
...ources/Shared/Classes/SpotsControllerManager.swift 77.46% <100%> (+0.05%) :arrow_up:
Sources/iOS/Classes/SpotsController.swift 66.03% <100%> (+0.21%) :arrow_up:
SpotsTests/tvOS/SpotsScrollViewTVOSTests.swift 0% <0%> (-100%) :arrow_down:
SpotsTests/tvOS/SpotsControllerTVOSTests.swift 0% <0%> (-100%) :arrow_down:
...potsTests/Shared/ComponentFocusDelegateTests.swift 0% <0%> (-86.37%) :arrow_down:
SpotsTests/iOS/ComponentDelegateiOSTests.swift 81.01% <0%> (-3.8%) :arrow_down:
...urces/iOS/Extensions/Delegate+iOS+Extensions.swift 88.88% <0%> (-1.24%) :arrow_down:

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 672c65d...d96e245. Read the comment docs.