jdross
jdross

Reputation: 1206

Stop IOS animations appearing all at once

I have heard that IOS will batch animations.

for example, I have about 4 methods thats do some updates (on main thread) and when they are done, I call a method to fade in a image of a check mark showing its complete. (see below) However it seems they all appear at the same time. How could I make them appear after each method call?

[mySubClass1 UpdateAllGeneralData_Single];
[self FadeImageGeneralInfo];

[mySubClass1 UpdateAllMeetingData_Single];
[self FadeImageMeetingList];

[mySubClass1 UpdateAllSpeakerData_Single];
[self FadeImageSpeakerList];

Upvotes: 0

Views: 126

Answers (1)

Mathew
Mathew

Reputation: 1798

You could use a timer to delay each subsequent call to FadeImage____List by a certain amount, or you could use the UIView animateWithDuration:delay:options:animations:completion: class method to delay each subsequent animation.

If you choose option 2, the easiest way to implement it is probably to change FadeImage______List to accept a delay argument. Then, for example (if each animation took 0.5 seconds):

[mySubClass1 UpdateAllGeneralData_Single];
[self FadeImageGeneralInfoWithDelay:0];

[mySubClass1 UpdateAllMeetingData_Single];
[self FadeImageMeetingListWithDelay:0.5];

[mySubClass1 UpdateAllSpeakerData_Single];
[self FadeImageSpeakerListWithDelay:1.0];

Upvotes: 1

Related Questions