@@ -129,6 +129,10 @@ public struct AnimatedImage : PlatformViewRepresentable {
129
129
public func updateNSView( _ nsView: AnimatedImageViewWrapper , context: NSViewRepresentableContext < AnimatedImage > ) {
130
130
updateView ( nsView, context: context)
131
131
}
132
+
133
+ public static func dismantleNSView( _ nsView: AnimatedImageViewWrapper , coordinator: ( ) ) {
134
+ dismantleView ( nsView, coordinator: coordinator)
135
+ }
132
136
#else
133
137
public func makeUIView( context: UIViewRepresentableContext < AnimatedImage > ) -> AnimatedImageViewWrapper {
134
138
makeView ( context: context)
@@ -137,6 +141,10 @@ public struct AnimatedImage : PlatformViewRepresentable {
137
141
public func updateUIView( _ uiView: AnimatedImageViewWrapper , context: UIViewRepresentableContext < AnimatedImage > ) {
138
142
updateView ( uiView, context: context)
139
143
}
144
+
145
+ public static func dismantleUIView( _ uiView: AnimatedImageViewWrapper , coordinator: ( ) ) {
146
+ dismantleView ( uiView, coordinator: coordinator)
147
+ }
140
148
#endif
141
149
142
150
func makeView( context: PlatformViewRepresentableContext < AnimatedImage > ) -> AnimatedImageViewWrapper {
@@ -175,6 +183,14 @@ public struct AnimatedImage : PlatformViewRepresentable {
175
183
layoutView ( view, context: context)
176
184
}
177
185
186
+ static func dismantleView( _ view: AnimatedImageViewWrapper , coordinator: ( ) ) {
187
+ #if os(macOS)
188
+ view. wrapped. animates = false
189
+ #else
190
+ view. wrapped. stopAnimating ( )
191
+ #endif
192
+ }
193
+
178
194
func layoutView( _ view: AnimatedImageViewWrapper , context: PlatformViewRepresentableContext < AnimatedImage > ) {
179
195
// AspectRatio
180
196
if let _ = imageLayout. aspectRatio {
0 commit comments