Skip to content

Commit ab7a54c

Browse files
committed
Stop animtiong when dismantle for watchOS AnimatedImage
1 parent 8441718 commit ab7a54c

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
@@ -175,6 +175,10 @@ public struct AnimatedImage : PlatformViewRepresentable {
175175
layoutView(view, context: context)
176176
}
177177

178+
public static func dismantleWKInterfaceObject(_ view: SDAnimatedImageInterface, coordinator: ()) {
179+
view.stopAnimating()
180+
}
181+
178182
func layoutView(_ view: SDAnimatedImageInterface, context: PlatformViewRepresentableContext<AnimatedImage>) {
179183
// AspectRatio
180184
if let _ = imageLayout.aspectRatio {

0 commit comments

Comments
 (0)