Hi guys,
I was hoping to find a way to animate each object of an array of uiviews one after another like the crowd doing the wave at a stadium.
My array is set up and I am currently able to get one or all of the objects to animate but I have no idea how to get the object a index 0 to jump, and then the object at index 1 to jump, and so on with a slight delay after each one.
This is the code I currently have that allows me to have one object from the array pulse based on the object at index helloInt. I have tried various ++ ideas but unfortunately for me I am not very proficient in object c and my google searches have not given me what I want (probably don't know what I am searching for I guess)
Code:
- (void) pulse {
currentView.transform = CGAffineTransformMakeScale(0.6, 0.6);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.2];
[UIView setAnimationDelegate:self];
currentView.transform = CGAffineTransformMakeScale(0.5, 0.5);
currentView.transform = CGAffineTransformMakeScale(1.3, 1.3);
currentView.transform = CGAffineTransformMakeScale(1.0, 1.0);
[UIView commitAnimations];
UIButton *popButton = [arrayPlayer1btns objectAtIndex:helloInt];
currentView = popButton;
popButton.highlighted = YES;
}
Here is some code I use with the array I am talking about. Here I am hiding certain objects in the array based on whether they are above or below a certain int.
Code:
-(IBAction)hideMyButtons:(id)sender {
NSLog(@"hideMyButtons Array is: %@",arrayPlayer1btns);
for (int i=0; i< [arrayPlayer1btns count]; i++){
UIButton *button = [arrayPlayer1btns objectAtIndex:i];
BOOL shouldHide = (i>(addThisToA + previousScoreA));
NSLog(@"button:%x shouldHide:%d",button, shouldHide);
button.hidden=shouldHide;
currentView = button;
}
EDIT:
i don't need help with the animation aspect, more specifically I would like help with iteration through the array I guess.
Hopefully I explained my question clearly. If anyone out there has the time any help would be appreciated.
Thanks,
Rob