从动画块中排除

Pab*_*blo 3 iphone animation

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
...
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)

例如,我需要有条件地为帧的宽度设置动画,以及其他强制性的修改.我不能把代码放出这个块的原因,因为块内有一个函数调用.如何从动画块中排除某些操作?

ohh*_*hho 9

结帐setAnimationsEnabled:

[UIView beginAnimations:@"Ani" context:NULL];
[UIView setAnimationDuration:1.0];
  // some animations
[UIView setAnimationsEnabled:NO];
  // animations disabled (put exclusions here)
[UIView setAnimationsEnabled:YES];
  // some more animations
[UIView commitAnimations];  
Run Code Online (Sandbox Code Playgroud)