Mart Coul
Mart Coul

Reputation: 490

iOS Simultaneous Animations

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).

Upvotes: 1

Views: 4199

Answers (1)

Robot Woods
Robot Woods

Reputation: 5687

- (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

Upvotes: 6

Related Questions