Closed dreampiggy closed 4 years ago
Merging #94 into master will increase coverage by
2.03%
. The diff coverage is85.96%
.
@@ Coverage Diff @@
## master #94 +/- ##
==========================================
+ Coverage 73.49% 75.53% +2.03%
==========================================
Files 9 9
Lines 732 748 +16
==========================================
+ Hits 538 565 +27
+ Misses 194 183 -11
Flag | Coverage Δ | |
---|---|---|
#ios | 75.53% <85.96%> (+2.03%) |
:arrow_up: |
Impacted Files | Coverage Δ | |
---|---|---|
SDWebImageSwiftUI/Classes/ImageViewWrapper.swift | 82.69% <77.77%> (-1.03%) |
:arrow_down: |
SDWebImageSwiftUI/Classes/WebImage.swift | 84.51% <80.00%> (+4.51%) |
:arrow_up: |
SDWebImageSwiftUI/Classes/ImageManager.swift | 75.71% <83.33%> (+4.44%) |
:arrow_up: |
SDWebImageSwiftUI/Classes/AnimatedImage.swift | 73.89% <90.32%> (+1.29%) |
:arrow_up: |
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 7458f13...63201c7. Read the comment docs.
This PR supports the
@ViewBuilder
API to create placeholder onAnimatedImage
.The channlege is that
AnimatedImage
useUIViewRepresentable
, which thebody
func is override by SwiftUI internel logic. So we can not use the same design asWebImage
(which return different Image based on loading status)So, instead, we use the HostingView, to inject the View Hierarchy. The placeholder is above the original SDAnimatedImageView, and controls its
isHidden
property during loading.Note the placeholder and indicator can be used at the same time, we need to considerate this case and adjust the View Hierarchy level