Fix the compile issue on macOS

This commit is contained in:
DreamPiggy 2020-02-25 10:37:11 +08:00
parent 608b861f6e
commit 8979158b38
1 changed files with 4 additions and 0 deletions

View File

@ -199,7 +199,11 @@ public struct AnimatedImage : PlatformViewRepresentable {
// This is a hack because of Xcode 11.3 bug, the @Published does not trigger another `updateUIView` call // This is a hack because of Xcode 11.3 bug, the @Published does not trigger another `updateUIView` call
// Here I have to use UIKit API to triger the same effect (the window change implicitly cause re-render) // Here I have to use UIKit API to triger the same effect (the window change implicitly cause re-render)
if let hostingView = AnimatedImage.findHostingView(from: view) { if let hostingView = AnimatedImage.findHostingView(from: view) {
#if os(macOS)
hostingView.viewDidMoveToWindow()
#else
hostingView.didMoveToWindow() hostingView.didMoveToWindow()
#endif
} }
if let image = image { if let image = image {
self.imageHandler.successBlock?(image, cacheType) self.imageHandler.successBlock?(image, cacheType)