Skip to content

Instantly share code, notes, and snippets.

@edudnyk
Created July 30, 2019 00:59
Show Gist options
  • Save edudnyk/898ec0fcfc6dfb725b260ec52775f8c9 to your computer and use it in GitHub Desktop.
Save edudnyk/898ec0fcfc6dfb725b260ec52775f8c9 to your computer and use it in GitHub Desktop.
extension LKLabel {
open override func action(for layer: CALayer, forKey event: String) -> CAAction? {
let result = super.action(for: layer, forKey: event)
if event == keyPath(\CALayer.bounds) && result != nil && UIView.inheritedAnimationDuration > 0 {
let textDrawingBoundsAction = LKBoundsDidChangeAction(fromBounds: layer.bounds)
let action = LKCompositeAction(actions:[result!, textDrawingBoundsAction])
return action
}
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment