1

I have 2 images in my view. On a click of a button, I'd like to move them both lower on the screen at the same time. Do I need to create 2 thread to have this to run simultaneously or there is a simple way to generate multiple animations to start at the same time.

Any link to a tutorial or documentation would be fine, I can probably figure it out then (I've tried to search on google but haven't found yet what I'm looking for).

Triad sou.
  • 2,969
  • 3
  • 23
  • 27
Mart Coul
  • 490
  • 6
  • 15

1 Answers1

6
- (IBAction)moveLowerOnClick{
       [UIView beginAnimations:nil context:NULL];
       self.somethingToMove.frame = CGRectOffset(self.somethingToMove.frame, 0, 50);
       self.anotherThingToMove.frame = CGRectOffset(self.anotherThingToMove.frame, 0, 50);
       [UIView commitAnimations];
}

but here: iPhone UIView Animation Best Practice is some discussion about alternates

Community
  • 1
  • 1
Robot Woods
  • 5,677
  • 2
  • 21
  • 30