ios - UIView animation completion block execute immediately -


-(void)methodxxxx {         [uiview animatewithduration:11 animations:^{                //...some animation changes...             } completion:^(bool finished) {                   [_fallbtn removefromsuperview];                   _fallbtn = nil;             }        }]; } 

i call method @ -viewdidappear , while directly call completion block.

why? there strange things ive missed?

i found 1 more wired thing:

cakeyframeanimation *pathanimation = [cakeyframeanimation animationwithkeypath:@"position"];     pathanimation.calculationmode = kcaanimationpaced;     pathanimation.fillmode = kcafillmodeforwards;     pathanimation.removedoncompletion = yes; //if set yes, directly call -animationdidstop method; if no, animation execute while never call -animationdidstop     pathanimation.duration = 10;     pathanimation.delegate = self; //here implement -animationdidstop method 

use below code.

-(void)viewdidappear:(bool)animated {          [self performselector:@selector(methodxxxx) withobject:nil afterdelay:0.1f];     }  -(void)methodxxxx {      [uiview animatewithduration:11 animations:^             //...some animation changes...         } completion:^(bool finished) {             [_fallbtn removefromsuperview];             _fallbtn = nil;     }]; } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -