You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example, a sequence of runnables is set to run on firstNode: the 1 second duration Fade runnable is redirected to run on secondNode, and then the 1 second duration Scale runnable runs on firstNode.
It would be reasonable to expect that secondNode will fade out over 1 second, and afterwards, firstNode will double in size over 1 second, and that the entire sequence should take 2 seconds total to run.
But that is not how the .changeTarget(to:) modifier currently behaves. Once the fade is redirected to secondNode and begins to execute, that step in the sequence is considered to be complete, and the scale on firstNode will begin, so the 2 nodes will end up animating at the same time. The total duration of the sequence will be around 1 second.
I think the first behavior should be implemented because it simplifies the coordination of animations across multiple nodes. A workaround is to keep nesting redirections, shown in the second block of code, but this is both harder to write and read.
In the following example, a sequence of runnables is set to run on
firstNode
: the 1 second durationFade
runnable is redirected to run onsecondNode
, and then the 1 second durationScale
runnable runs onfirstNode
.It would be reasonable to expect that
secondNode
will fade out over 1 second, and afterwards,firstNode
will double in size over 1 second, and that the entire sequence should take 2 seconds total to run.But that is not how the
.changeTarget(to:)
modifier currently behaves. Once the fade is redirected tosecondNode
and begins to execute, that step in the sequence is considered to be complete, and the scale onfirstNode
will begin, so the 2 nodes will end up animating at the same time. The total duration of the sequence will be around 1 second.I think the first behavior should be implemented because it simplifies the coordination of animations across multiple nodes. A workaround is to keep nesting redirections, shown in the second block of code, but this is both harder to write and read.
Convoluted workaround to implement expected behavior:
The text was updated successfully, but these errors were encountered: