Skip to content

Commit 8979158

Browse files
committed
Fix the compile issue on macOS
1 parent 608b861 commit 8979158

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ public struct AnimatedImage : PlatformViewRepresentable {
199199
// This is a hack because of Xcode 11.3 bug, the @Published does not trigger another `updateUIView` call
200200
// Here I have to use UIKit API to triger the same effect (the window change implicitly cause re-render)
201201
if let hostingView = AnimatedImage.findHostingView(from: view) {
202+
#if os(macOS)
203+
hostingView.viewDidMoveToWindow()
204+
#else
202205
hostingView.didMoveToWindow()
206+
#endif
203207
}
204208
if let image = image {
205209
self.imageHandler.successBlock?(image, cacheType)

0 commit comments

Comments
 (0)