@@ -72,8 +72,8 @@ public struct AnimatedImage : PlatformViewRepresentable {
72
72
var placeholder : PlatformImage ?
73
73
74
74
// Coordinator
75
- var viewCreateBlock : ( ( PlatformView , PlatformViewRepresentableContext < AnimatedImage > ) -> Void ) ?
76
- var viewUpdateBlock : ( ( PlatformView , PlatformViewRepresentableContext < AnimatedImage > ) -> Void ) ?
75
+ var viewCreateBlock : ( ( PlatformView , Context ) -> Void ) ?
76
+ var viewUpdateBlock : ( ( PlatformView , Context ) -> Void ) ?
77
77
static var viewDestroyBlock : ( ( PlatformView , Coordinator ) -> Void ) ?
78
78
79
79
/// A Binding to control the animation. You can bind external logic to control the animation status.
@@ -217,15 +217,15 @@ public struct AnimatedImage : PlatformViewRepresentable {
217
217
}
218
218
}
219
219
220
- func makeView( context: PlatformViewRepresentableContext < AnimatedImage > ) -> AnimatedImageViewWrapper {
220
+ func makeView( context: Context ) -> AnimatedImageViewWrapper {
221
221
let view = AnimatedImageViewWrapper ( )
222
222
if let viewCreateBlock = viewCreateBlock {
223
223
viewCreateBlock ( view. wrapped, context)
224
224
}
225
225
return view
226
226
}
227
227
228
- func updateView( _ view: AnimatedImageViewWrapper , context: PlatformViewRepresentableContext < AnimatedImage > ) {
228
+ func updateView( _ view: AnimatedImageViewWrapper , context: Context ) {
229
229
// macOS SDAnimatedImageView.animates should initialize to true in advance before set image
230
230
#if os(macOS)
231
231
view. wrapped. animates = true
@@ -285,7 +285,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
285
285
}
286
286
}
287
287
288
- func layoutView( _ view: AnimatedImageViewWrapper , context: PlatformViewRepresentableContext < AnimatedImage > ) {
288
+ func layoutView( _ view: AnimatedImageViewWrapper , context: Context ) {
289
289
// AspectRatio && ContentMode
290
290
#if os(macOS)
291
291
let contentMode : NSImageScaling
@@ -442,7 +442,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
442
442
#endif
443
443
}
444
444
445
- func configureView( _ view: AnimatedImageViewWrapper , context: PlatformViewRepresentableContext < AnimatedImage > ) {
445
+ func configureView( _ view: AnimatedImageViewWrapper , context: Context ) {
446
446
#if os(macOS) || os(iOS) || os(tvOS)
447
447
// IncrementalLoad
448
448
if let incrementalLoad = self . incrementalLoad {
@@ -667,7 +667,7 @@ extension AnimatedImage {
667
667
/// Provide the action when view representable create the native view.
668
668
/// - Parameter action: The action to perform. The first arg is the native view. The seconds arg is the context.
669
669
/// - Returns: A view that triggers `action` when view representable create the native view.
670
- public func onViewCreate( perform action: ( ( PlatformView , PlatformViewRepresentableContext < AnimatedImage > ) -> Void ) ? = nil ) -> AnimatedImage {
670
+ public func onViewCreate( perform action: ( ( PlatformView , Context ) -> Void ) ? = nil ) -> AnimatedImage {
671
671
var result = self
672
672
result. viewCreateBlock = action
673
673
return result
@@ -676,7 +676,7 @@ extension AnimatedImage {
676
676
/// Provide the action when view representable update the native view.
677
677
/// - Parameter action: The action to perform. The first arg is the native view. The seconds arg is the context.
678
678
/// - Returns: A view that triggers `action` when view representable update the native view.
679
- public func onViewUpdate( perform action: ( ( PlatformView , PlatformViewRepresentableContext < AnimatedImage > ) -> Void ) ? = nil ) -> AnimatedImage {
679
+ public func onViewUpdate( perform action: ( ( PlatformView , Context ) -> Void ) ? = nil ) -> AnimatedImage {
680
680
var result = self
681
681
result. viewUpdateBlock = action
682
682
return result
0 commit comments