[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
...
[UIView commitAnimations];
For example I need to animate frame's width conditionally, along with the rest of other modifications which are mandatory. The reason I can't put the code out of this block, because there is a function call within the block. How would I exclude some operations from within animation block?