This repository was archived by the owner on Aug 30, 2023. It is now read-only.
File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -342,8 +342,21 @@ - (void)addAnimation:(CABasicAnimation *)animation
342
342
animation.beginTime = ([layer convertTime: CACurrentMediaTime () fromLayer: nil ]
343
343
+ traits.delay * timeScaleFactor);
344
344
animation.fillMode = kCAFillModeBackwards ;
345
+ } else if (@available (iOS 14 , *)) {
346
+ // iOS 14 introduced a behavioral change for animations such that they no longer appear to
347
+ // immediately be committed to the render server, potentially resulting in a brief flicker to
348
+ // the model layer's value before the animation takes effect. This could reasonably be
349
+ // considered a bug in iOS.
350
+ // To work around this, we can explicitly enforce the contract that this animation is expected
351
+ // to start "now" in terms of render server timing. This does mean we may lose some microseconds
352
+ // of animation timing at the beginning of the animation, so we only apply this on iOS 14+ where
353
+ // it's needed. If and when iOS fixes this bug we can remove the following line and lean on the
354
+ // render server choosing the appropriate start time once the animation is flushed to the render
355
+ // server.
356
+ animation.beginTime = [layer convertTime: CACurrentMediaTime () fromLayer: nil ];
345
357
}
346
358
359
+
347
360
[_registrar addAnimation: animation toLayer: layer forKey: key completion: completion];
348
361
}
349
362
You can’t perform that action at this time.
0 commit comments