Last active
July 28, 2019 17:09
-
-
Save edudnyk/a7cd14432d0412e3bb767b520a3eb07a to your computer and use it in GitHub Desktop.
This file contains 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
@objc @NSManaged open dynamic var attributedText : NSAttributedString? | |
open override func action(forKey event: String) -> CAAction? { | |
if event == keyPath(\LKLabelLayer.attributedText) { | |
/// Create and return our text interpolating `CAAction` instance here | |
} | |
return super.action(forKey:event) | |
} | |
open override class func needsDisplay(forKey key: String) -> Bool { | |
var result = super.needsDisplay(forKey: key) | |
result = result || key == keyPath(\LKLabelLayer.attributedText) | |
return result | |
} | |
func keyPath<Root, Key>(_ keyPath: KeyPath<Root, Key>)->String { | |
return NSExpression(forKeyPath: keyPath).keyPath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment