Created
July 30, 2019 00:59
-
-
Save edudnyk/898ec0fcfc6dfb725b260ec52775f8c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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