I’m trying to delay between turning each button’s alpha to 0.0, but what I have is not working.
[UIView animateWithDuration:1.5 delay:.25 options:UIViewAnimationCurveLinear animations:^{button.alpha = 0.0;
button2.alpha = 0.0;
button3.alpha = 0.0;
button4.alpha = 0.0;
button5.alpha = 0.0;} completion:^(BOOL finished){ ; }];
How does one animate with a delay?
The delay is to start the animation, not a delay between each change in the animation block.
You’ve made things unnecessarily difficult on yourself by having a sequence of buttons and deciding to create individual variables manually instead of using an array. If you’ve got a collection of variables, you should usually store them in a collection of some sort.
Here’s one way you could do it if they were in an array: