Reputation: 2285
The Details:
DispatchQueue.main.asyncAfter(deadline: ...
to update the snapPoint
of a UISnapBehavior
, which causes the view associated with the snap behavior to snap (with animation) to the new snap point.snapPoint
of three circular views each of which are stacked one on top of the other.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:
What is going on here?
Upvotes: 0
Views: 69
Reputation: 2285
Using Timer
(Swift) or NSTimer
(Objective-C) instead of GCD (Grand Central Dispatch) is allowing me to make these nuanced delays in animations with expected behavior.
However, I do not know why this works. I greatly welcome explanations as to what is happening under the hood or if it is possible to achieve the same effect with GCD.
Upvotes: 0