File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Animator {
20
20
private var displayLinkInitialized : Bool = false
21
21
22
22
/// A delegate responsible for displaying the GIF frames.
23
- private weak var delegate : GIFAnimatable !
23
+ private weak var delegate : ( any GIFAnimatable ) !
24
24
25
25
/// Callback for when all the loops of the animation are done (never called for infinite loops)
26
26
private var animationBlock : ( ( ) -> Void ) ? = nil
@@ -55,7 +55,7 @@ public class Animator {
55
55
/// - parameter view: A view object that implements the `GIFAnimatable` protocol.
56
56
///
57
57
/// - returns: A new animator instance.
58
- public init ( withDelegate delegate: GIFAnimatable ) {
58
+ public init ( withDelegate delegate: any GIFAnimatable ) {
59
59
self . delegate = delegate
60
60
}
61
61
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ extension GIFAnimatable {
133
133
public func prepareForAnimation( withGIFData imageData: Data ,
134
134
loopCount: Int = 0 ,
135
135
completionHandler: ( ( ) -> Void ) ? = nil ) {
136
- if var imageContainer = self as? ImageContainer {
136
+ if var imageContainer = self as? any ImageContainer {
137
137
imageContainer. image = UIImage ( data: imageData)
138
138
}
139
139
@@ -209,7 +209,7 @@ extension GIFAnimatable {
209
209
210
210
/// Updates the image with a new frame if necessary.
211
211
public func updateImageIfNeeded( ) {
212
- if var imageContainer = self as? ImageContainer {
212
+ if var imageContainer = self as? any ImageContainer {
213
213
let container = imageContainer
214
214
imageContainer. image = activeFrame ?? container. image
215
215
} else {
You can’t perform that action at this time.
0 commit comments