3 ms·
Does iOS runtime not use evented I/O? Coming from web, I would expect tap events to queue up while the thread is busy with an animation.
by bcherny 9y ago
Does iOS runtime not use evented I/O? Coming from web, I would expect tap events to queue up while the thread is busy with an animation.
- tedunangst 9y agoWhile the button is animating, it simply doesn't respond to touches. There's no thread that's stuck. 1 + 2 - 3 consistently produces the correct result because + and - are different buttons.
- gdubs 9y agoIt’s a simpler matter of not passing “allowuserinteraction” to the UIView animation options.
- xenadu02 9y agoCoreAnimation runs animations on a background thread using state snapshots. The event loop is processing events during the animation. It is up to the programmer to decide if events are ignored or processed during animations because what that means depends on what you want to happen: is the animation interactive and reversible? Does tapping reset the animation or does it start animating to the new state from its existing state? CoreAnimation does the work based on the policies you select (eg: interpolating between a half-complete animation and the new desired end state).
- LeoNatan25 9y agoCorrection—CA animations process and render in a render server process. This is why even when the main thread is blocked, animations can continue.