So the BELOW code shows animation of all those colors in the order that I placed it. However, how would I make it that the colors appear in no particular order but instead appear in RANDOM order?
bird.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@"red.png"],
[UIImage imageNamed:@"brown.png"],
[UIImage imageNamed:@"green.png"],
[UIImage imageNamed:@"gold.png"],
[UIImage imageNamed:@"black.png"], nil];
[bird setAnimationRepeatCount:0];
bird.animationDuration=1;
[bird startAnimating];
If you have created all of these images and added them to the project, then you can just write a helper method to get yourself a random image. It might look like this:
If you wanted to make things even more flexible, you could get rid of the images you added to the project and just create any colored image on the fly with the help of the Core Graphics library and this cool github repo: https://gist.github.com/kylefox/1689973 . The magic there is in these 4 lines (which generate a random color):