Calayer implicit animation


My notes on implicit animation

CALayer and implicit animation

The animation was left in intentionally for this test. Animation won’t be apart of Element yet.
img

Stop implicit animation on a layer in swift:

override func actionForLayer(layer: CALayer, forKey event: String) -> CAAction? {
    return NSNull()
}

alternative: (sandwich your property change)

CATransaction.begin()
CATransaction.setValue(kCFBooleanTrue, forKey: kCATransactionDisableActions)
// change properties here without animation
CATransaction.commit()

Remember to set the delegate of your CALayer instance to an instance of a class that at least extends NSObject. In this example we extend NSView.