我在动画中遇到了麻烦。这里是一些代码:在使用“UIView animateWithDuration:......”时出现问题。
//wobbling cells in collection view controller
if (_isEdit){
myCell.transform = CGAffineTransformMakeRotation(-0.01);
[UIView animateWithDuration:0.12
delay:0.0
options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveLinear
animations:^{
myCell.transform = CGAffineTransformMakeRotation(0.01);
} completion:nil];
}
我想要的是当“_isEdit == YES;”细胞摇摆。
但是,如果我推动到另一个ViewController时,细胞摇摆, 然后解雇。动画停止(“_isEdit”仍为“YES”)...
我该如何保持动画的工作?
使用'self.isEdit'然后尝试。 – PiyushRathi