I know you can perform a two-stage animataion using blocks like so:
[UIView animateWithDuration:25.0 delay:0.0 options:UIViewAnimationCurveLinear animations:
^{
aView.alpha = 2.5;
}
completion:^(BOOL finished)
{
aView.hidden = YES;
}
];
..but how would I create a multistage (more than 2) animation using blocks?
or you can make a recursive, multi-stage animation method:
-(void) multiStageAnimate{
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//animation code
}
completion:^(BOOL finished){
if(/* If terminating condition not met*/)
[self multiStageAnimate];
}];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With