WDActivityIndicator icon indicating copy to clipboard operation
WDActivityIndicator copied to clipboard

NSTimer

Open kohtenko opened this issue 10 years ago • 0 comments

Hi, NSTimer in your control is never stops and because of that object never released. Actually, I think you don't even need NSTimer. Try this for smooth rotation:

define RADIANS(degrees) ((degrees * M_PI) / 180.0)

  • (void)startAnimating { [self.activityImageView.layer removeAnimationForKey:@"ROTATE_ANIMATION"]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; animation.duration = 0.1; animation.cumulative = YES; animation.repeatCount = NSIntegerMax; animation.toValue = @(M_2_PI); animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; animation.removedOnCompletion = NO;

    [self.activityImageView.layer addAnimation:animation forKey:@"ROTATE_ANIMATION"];

    self.hidden = NO; }

  • (void)stopAnimating { [self.activityImageView.layer removeAnimationForKey:@"ROTATE_ANIMATION"]; }

kohtenko avatar Jun 26 '14 14:06 kohtenko