ios - addCoordinatedAnimations animation block not running -


in tvos on xcode 7.3.1, 1 of places use uifocusanimationcoordinator's addcoordinatedanimations function running completion before animation:

if (coordinator != nil) {     var tempdidanimate: bool = false  // breakpoint 1     coordinator!.addcoordinatedanimations({         self.myfunctionthatdoesntgetcalled() // breakpoint 2         tempdidanimate = true         }, completion: {             () in             if tempdidanimate == false {                 print("whaaaat?!??")  // breakpoint 3                 self.myfunctionthatdoesntgetcalled()                                     }     }) } 

order of breakpoints being hit 1, 3. never 2.

this hacky use of if tempdidanimate == false solve problem, don't why problem happening.

any ideas wrong?

one idea: i'm inside addcoordinatedanimations block in stack... don't think so, stack complicated... can't see way check via code.

tl;dr: yes inside animation block #$&^@#$!

ok, turned out in "cleverly" refactored code, forgetting i'm calling animation block reset active autolayout animations (by requesting new animation duration 0). in completion, code above being called... since i'm officially inside animation block, os refuses execute main animation block above, , skips right completion. don't know if os behavior documented anywhere.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -