The Details:
- I am using
DispatchQueue.main.asyncAfter(deadline: ...
to update thesnapPoint
of aUISnapBehavior
, which causes the view associated with the snap behavior to snap (with animation) to the new snap point. - I want to update the
snapPoint
of three circular views each of which are stacked one on top of the other. - I want to update the
snapPoint
of each consecutively. In other words, I want view A to start animating into position at t0, view B to start animating at t1, and view C to start animating at t2.
The Problem:
The timing of the animations is bizarre. For example:
- If the difference between t0, t1, and t2 is 100 milliseconds, they all snap to their respective snap points at exactly the same time.
- However, if the difference between t0, t1, and t2 is 200 milliseconds, then view A and view B snap to their respective positions at the same time, but view C snaps to its new snap point at a totally different time later than the first two.
- Even more bizarre, if the difference between t0, t1, and t2 reach 400 milliseconds, then view A animates on its own, and views B and C animate together.
- Finally, if the difference reaches 500 milliseconds, each view animates at a different time.
What is going on here?