I have a CALayer
in an AVMutableComposition
that is faded in, should stay on screen for a while and then disappear. The problem is, it should disappear without an animation, but CABasicAnimation
has a minimum duration of 0.25 seconds.
How would can I achieve to set the opacity of the layer after a given time without animating it?
Encapsulating the removal of the layer into a Core Animation transaction where you disable animations:
[CATransaction begin];
[CATransaction setDisableActions:YES];
// remove the layer from its hierarchy
[CATransaction commit];
or the same in Swift:
CATransaction.begin()
CATransaction.setDisableActions(true)
// remove the layer from its hierarchy
CATransaction.commit()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With