In short the nested animation allows to run 2 independent animations simultaneously. But what to do if I have a complex code which consists of both animated and non-animated code? I mean the following situation:
[UIView animateWithDuration:...
animations:^{
...//code1 - with animation
...//code2 - also contains code which shouldn't be animated
}];
Code2
looks like the calling of the following method:
- (void)someMethod {
...//code3 - without animation
[self someMethod2Animated:NO completion:^{
[self someMethod2Animated:YES completion:^{
NSLog(...);
}];
}];
}
Where someMethod2
executes the same code but maybe inside the animatedWithDuration:animations:completion:
depending on the given BOOL
variable.
If I run this code then I see that all the code parts are animated. I tried to set the durations of the code2
to zero but it has no effect (the code is still animated).
Could you suggest how to solve this issue without of rewriting all the code? I heared about some solutions like ReactiveCocoa
but it seems they are suitable for network/separate asynchronous requests only.
Edited
PromiseKit 2.0 allows to convert enclosed animation blocks to a sequence of blocks but it doesn't support iOS 7 I need.