When I set the backgroundColor property of an CALayer instance, the change seems to be slightly animated. But I don\'t want that in my case. How ca
I've taken Ben's answer and made a Swift helper function, here it is in case it'll be useful for anyone:
func withoutCAAnimations(closure: () -> ()) {
CATransaction.begin()
CATransaction.setValue(kCFBooleanTrue, forKey: kCATransactionDisableActions)
closure()
CATransaction.commit()
}
# Example usage:
withoutCAAnimations { layer.backgroundColor = greenColor; }