Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

animation completion called immediately

I have the following animation block:

[UIView animateWithDuration:2 
                 animations:^{ 
                     [childViewController_.view setAlpha:0];  
                 } 
                 completion:^(BOOL finished) {
                     [childViewController_.view removeFromSuperview];
                 }];

When performed as above, the completion block is called immediately. If I don't have the completion block however, then the animation is performed as expected.

What am I doing wrong here?

Update
The finished flag in the completion block is NO.

like image 958
LK. Avatar asked May 16 '11 22:05

LK.


People also ask

How to plan your first animated video?

Step 1: Gathering Information Step 2: Concept & Script Step 3: Voiceover Recording Step 4: Storyboard Step 5: Visual Style Step 6: Animation Step 7: Music Delivery Planning your first animated video? Whether you are creating your own or looking to hire a video production company, it is essential to know the animation production process behind it.

What is an animated explainer video framework?

This basically means creating a framework for the animated explainer video. Once we have approval from the client, we use the concept as a base to create an engaging script that effectively communicates the message to be delivered.

What is the 2D animation process?

What is the Animation Process? The 2D animation process is the technique of creating the illusion of movement using still images in a two-dimensional space. It includes characters, storyboards, and backgrounds in the form of vector graphics.

How to write an animated explainer video script?

When you’re writing an animated explainer video script, here is a list of things you must take note of: The ideal length for an animated video is 60 to 90 seconds, which amounts to an average of 150 to 225 words for the video script.


1 Answers

You just forgot to check one condition

[UIView animateWithDuration:2 
                 animations:^{ 
                     [childViewController_.view setAlpha:0];  
                 } 
                 completion:^(BOOL finished) {
                     if (finished)
                     {
                          [childViewController_.view removeFromSuperview];
                     }
                 }];
like image 75
Nirav Gadhiya Avatar answered Nov 08 '22 23:11

Nirav Gadhiya