@@ -181,18 +181,18 @@ - (void)setProgress:(CGFloat)progress animated:(BOOL)animated
181
181
- (void )animateProgress : (CADisplayLink *)displayLink
182
182
{
183
183
dispatch_async (dispatch_get_main_queue (), ^{
184
- CGFloat dt = (displayLink.timestamp - _animationStartTime ) / self.animationDuration ;
184
+ CGFloat dt = (displayLink.timestamp - self. animationStartTime ) / self.animationDuration ;
185
185
if (dt >= 1.0 ) {
186
186
// Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
187
187
[self .displayLink invalidate ];
188
188
self.displayLink = nil ;
189
- [super setProgress: _animationToValue animated: NO ];
189
+ [super setProgress: self .animationToValue animated: NO ];
190
190
[self setNeedsDisplay ];
191
191
return ;
192
192
}
193
193
194
194
// Set progress
195
- [super setProgress: _animationFromValue + dt * (_animationToValue - _animationFromValue ) animated: YES ];
195
+ [super setProgress: self .animationFromValue + dt * (self .animationToValue - self .animationFromValue ) animated: YES ];
196
196
[self setNeedsDisplay ];
197
197
198
198
});
@@ -230,9 +230,9 @@ - (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
230
230
[CATransaction begin ];
231
231
[_iconLayer addAnimation: [self hideAnimation ] forKey: kM13ProgressViewPieHideKey ];
232
232
[CATransaction setCompletionBlock: ^{
233
- _currentAction = action;
233
+ self. currentAction = action;
234
234
[self drawIcon ];
235
- [_iconLayer addAnimation: [self showAnimation ] forKey: kM13ProgressViewPieShowKey ];
235
+ [self .iconLayer addAnimation: [self showAnimation ] forKey: kM13ProgressViewPieShowKey ];
236
236
}];
237
237
[CATransaction commit ];
238
238
}
@@ -254,9 +254,9 @@ - (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
254
254
[CATransaction begin ];
255
255
[_iconLayer addAnimation: [self hideAnimation ] forKey: kM13ProgressViewPieHideKey ];
256
256
[CATransaction setCompletionBlock: ^{
257
- _currentAction = action;
257
+ self. currentAction = action;
258
258
[self drawIcon ];
259
- [_iconLayer addAnimation: [self showAnimation ] forKey: kM13ProgressViewPieShowKey ];
259
+ [self .iconLayer addAnimation: [self showAnimation ] forKey: kM13ProgressViewPieShowKey ];
260
260
}];
261
261
[CATransaction commit ];
262
262
}
@@ -272,7 +272,7 @@ - (void)setIndeterminate:(BOOL)indeterminate
272
272
273
273
// Create the rotation animation
274
274
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath: @" transform.rotation.z" ];
275
- rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
275
+ rotationAnimation.toValue = [NSNumber numberWithFloat: ( float )( M_PI * 2.0 ) ];
276
276
rotationAnimation.duration = 1 ;
277
277
rotationAnimation.cumulative = YES ;
278
278
rotationAnimation.repeatCount = HUGE_VALF;
@@ -290,7 +290,7 @@ - (void)setIndeterminate:(BOOL)indeterminate
290
290
[_indeterminateLayer addAnimation: [self hideAnimation ] forKey: kM13ProgressViewPieHideKey ];
291
291
[CATransaction setCompletionBlock: ^{
292
292
// Remove the rotation animation and reset the background
293
- [_backgroundLayer removeAnimationForKey: @" rotationAnimation" ];
293
+ [self .backgroundLayer removeAnimationForKey: @" rotationAnimation" ];
294
294
[self drawBackground ];
295
295
}];
296
296
[CATransaction commit ];
@@ -337,7 +337,7 @@ - (void)layoutSubviews
337
337
338
338
// Update line widths if not overriden
339
339
if (!_backgroundRingWidthOverriden) {
340
- _backgroundRingWidth = fmaxf (self.frame .size .width * .025 , 1.0 );
340
+ _backgroundRingWidth = fmaxf (( float ) self.frame .size .width * .025f , 1.0 );
341
341
}
342
342
343
343
// Redraw
@@ -443,8 +443,8 @@ - (void)drawFailure
443
443
- (void )drawBackground
444
444
{
445
445
// Create parameters to draw background
446
- float startAngle = - M_PI_2;
447
- float endAngle = startAngle + (2.0 * M_PI);
446
+ float startAngle = - ( float ) M_PI_2;
447
+ float endAngle = ( float )( startAngle + (2.0 * M_PI) );
448
448
CGPoint center = CGPointMake (self.bounds .size .width / 2.0 , self.bounds .size .width / 2.0 );
449
449
CGFloat radius = (self.bounds .size .width - _backgroundRingWidth) / 2.0 ;
450
450
@@ -461,8 +461,8 @@ - (void)drawBackground
461
461
- (void )drawProgress
462
462
{
463
463
// Create parameters to draw progress
464
- float startAngle = - M_PI_2;
465
- float endAngle = startAngle + (2.0 * M_PI * self.progress );
464
+ float startAngle = - ( float ) M_PI_2;
465
+ float endAngle = ( float )( startAngle + (2.0 * M_PI * self.progress ) );
466
466
CGPoint center = CGPointMake (self.bounds .size .width / 2.0 , self.bounds .size .width / 2.0 );
467
467
CGFloat radius = (self.bounds .size .width - _backgroundRingWidth) / 2.0 ;
468
468
@@ -492,8 +492,8 @@ - (void)drawIcon
492
492
- (void )drawIndeterminate
493
493
{
494
494
// Create parameters to draw progress
495
- float startAngle = - M_PI_2;
496
- float endAngle = startAngle + (2.0 * M_PI * .2 );
495
+ float startAngle = - ( float ) M_PI_2;
496
+ float endAngle = ( float )( startAngle + (2.0 * M_PI * .2 ) );
497
497
CGPoint center = CGPointMake (self.bounds .size .width / 2.0 , self.bounds .size .width / 2.0 );
498
498
CGFloat radius = (self.bounds .size .width - _backgroundRingWidth) / 2.0 ;
499
499
0 commit comments