@@ -56,6 +56,8 @@ @interface SDAnimatedImageInterface () {
56
56
@property (nonatomic , assign , readwrite ) NSUInteger currentLoopCount;
57
57
@property (nonatomic , strong ) NSNumber *animationRepeatCount;
58
58
@property (nonatomic , assign ) BOOL shouldAnimate;
59
+ @property (nonatomic , copy ) NSRunLoopMode runLoopMode;
60
+ @property (nonatomic , assign ) double playbackRate;
59
61
@property (nonatomic ,strong ) SDAnimatedImagePlayer *player; // The animation player.
60
62
@property (nonatomic ) id <CALayerProtocol> imageViewLayer; // The actual rendering layer.
61
63
@@ -68,6 +70,10 @@ - (instancetype)init {
68
70
NSString *UUID = [NSUUID UUID ].UUIDString ;
69
71
NSString *property = [NSString stringWithFormat: @" %@ _%@ " , cls, UUID];
70
72
self = [self _initForDynamicCreationWithInterfaceProperty: property];
73
+ if (self) {
74
+ self.runLoopMode = NSRunLoopCommonModes ;
75
+ self.playbackRate = 1.0 ;
76
+ }
71
77
return self;
72
78
}
73
79
@@ -125,11 +131,11 @@ - (void)setImage:(UIImage *)image {
125
131
self.player .totalLoopCount = self.animationRepeatCount .unsignedIntegerValue ;
126
132
}
127
133
128
- // // RunLoop Mode
129
- // self.player.runLoopMode = self.runLoopMode;
130
- //
131
- // // Play Rate
132
- // self.player.playbackRate = self.playbackRate;
134
+ // RunLoop Mode
135
+ self.player .runLoopMode = self.runLoopMode ;
136
+
137
+ // Play Rate
138
+ self.player .playbackRate = self.playbackRate ;
133
139
134
140
// Setup handler
135
141
__weak typeof (self) wself = self;
0 commit comments