解决方法为
把函数名里所传需要的参数放到全局变量 即可
- (void)rotateWithSpeed:(CGFloat)spd { [UIView animateWithDuration:spd delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ self.blade.transform = CGAffineTransformRotate(self.blade.transform, M_PI_2); } completion:^(BOOL finished){ if (finished) { [self rotateWithSpeed:spd]; } }]; }
换为
- (void)rotateWithSpeed { [UIView animateWithDuration:self.spd delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ self.blade.transform = CGAffineTransformRotate(self.blade.transform, M_PI_2); } completion:^(BOOL finished){ if (finished) { [self rotateWithSpeed]; } }]; }
时间: 2024-12-25 19:34:48