File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -218,11 +218,13 @@ public struct AnimatedImage : PlatformViewRepresentable {
218
218
// This is a hack because of Xcode 11.3 bug, the @Published does not trigger another `updateUIView` call
219
219
// Here I have to use UIKit/AppKit API to triger the same effect (the window change implicitly cause re-render)
220
220
if let hostingView = AnimatedImage . findHostingView ( from: view) {
221
- #if os(macOS)
222
- hostingView. viewDidMoveToWindow ( )
223
- #else
224
- hostingView. didMoveToWindow ( )
225
- #endif
221
+ if let _ = hostingView. window {
222
+ #if os(macOS)
223
+ hostingView. viewDidMoveToWindow ( )
224
+ #else
225
+ hostingView. didMoveToWindow ( )
226
+ #endif
227
+ }
226
228
}
227
229
self . imageLoading. image = image
228
230
self . imageLoading. isLoading = false
You can’t perform that action at this time.
0 commit comments