Closed alfredcc closed 5 months ago
I find that the method onAppear
is not called on wathOS when id changes
https://github.com/SDWebImage/SDWebImageSwiftUI/blob/master/SDWebImageSwiftUI/Classes/WebImage.swift?#L308
If you read the code you will find only watchOS use different implementation. Because UIKit is not available
Yes, I saw that onPlatformAppear
used UIKit/AppKit behavior. On watchOS, this fallback method was not used. The buggy behavior of onAppear
in SwiftUI disrupted some logic. Therefore, currently, there isn't a very good way to handle this issue on watchOS.
May find a way to remove the dependency of onPlatformAppear
and implments the similiar effect.
But I doubt this will break that .indicator/.placeholder
behavior, which behaves like a composition view, not a single stateful view (no sounds suitable for SwiftUI)
Hello, maintainer, I have two strange bugs to report. I saw that the issue with loading a
nil
URL had been fixed before Fix nil url reloading, but it still exists on watchOS. Additionally, there's another issue on watchOS where the gif animation stops when I quickly switch URLs, which doesn't happen on the phone. I wrote a demo to easily reproduce this problem and created a file namedFastSwitchGifView
.https://github.com/alfredcc/SDWebImageSwiftUI/tree/bug-report-on-watchOS