I have code that runs fine for my animation. The problem is i want the whole animation to move to the left of the screen then stop and start again. Basically its a bear animating in place but i need the entire animation to move to the left across the screen. I dont want it to animate differently I just need it's x value to change but I'm stuck. Can someone please help. Here's what I have so far.
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *imageNames = @[@"bear1.gif", @"bear2.gif", @"bear3.gif", @"bear4.gif",
@"bear5.gif", @"bear6.gif"];
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i = 0; i < imageNames.count; i++)
{
[images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
// Normal Animation
UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(60, 95, 50, 50)]; animationImageView.animationImages = images; animationImageView.animationDuration = 0.5;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
// Do any additional setup after loading the view, typically from a nib.
}