@@ -56,6 +56,8 @@ @interface SDAnimatedImageInterface () {
5656@property (nonatomic , assign , readwrite ) NSUInteger currentLoopCount;
5757@property (nonatomic , strong ) NSNumber *animationRepeatCount;
5858@property (nonatomic , assign ) BOOL shouldAnimate;
59+ @property (nonatomic , copy ) NSRunLoopMode runLoopMode;
60+ @property (nonatomic , assign ) double playbackRate;
5961@property (nonatomic ,strong ) SDAnimatedImagePlayer *player; // The animation player.
6062@property (nonatomic ) id <CALayerProtocol> imageViewLayer; // The actual rendering layer.
6163
@@ -68,6 +70,10 @@ - (instancetype)init {
6870 NSString *UUID = [NSUUID UUID ].UUIDString ;
6971 NSString *property = [NSString stringWithFormat: @" %@ _%@ " , cls, UUID];
7072 self = [self _initForDynamicCreationWithInterfaceProperty: property];
73+ if (self) {
74+ self.runLoopMode = NSRunLoopCommonModes ;
75+ self.playbackRate = 1.0 ;
76+ }
7177 return self;
7278}
7379
@@ -125,11 +131,11 @@ - (void)setImage:(UIImage *)image {
125131 self.player .totalLoopCount = self.animationRepeatCount .unsignedIntegerValue ;
126132 }
127133
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 ;
133139
134140 // Setup handler
135141 __weak typeof (self) wself = self;
0 commit comments