1
我需要在重复动画之前调用某个方法。 我不知道该放哪一行代码。每当动画重复时调用一个方法
这是我的代码制作动画的对象:
[UIView animateWithDuration:speed
delay:delay
options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveLinear|UIViewAnimationOptionRepeat
animations:^(void){
cloud.frame = (CGRectMake(cloud.frame.origin.x, cloud.frame.origin.y+600, cloud.frame.size.width, cloud.frame.size.height));
}completion:^(BOOL finished){
if (finished){
[cloud setBackgroundImage:[UIImage imageNamed:@"cloudWhite.png"] forState:UIControlStateNormal];
}
}];
方法称为完成部分每重复之前,但只有在整个动画完成将不会被执行,与人一起重复 - 这在这种情况下,永远不会。
我的问题是,如何在每个动画重复之前调用方法?