I'm trying to use TTTAttributedLabel
from this repo: https://github.com/TTTAttributedLabel/TTTAttributedLabel
I have an IBOutlet
:
@IBOutlet weak var label: TTTAttributedLabel!
And when I try to add a link to the label using the code example translated to Swift:
self.label.enabledTextCheckingTypes = NSTextCheckingResult.CheckingType.link.rawValue
self.label.delegate = self
let nsstringText: NSString = "Fork me on GitHub! (https://github.com/mattt/TTTAttributedLabel/)"
self.label.text = nsstringText as String
let range = nsstringText.range(of: "me")
let url = URL(string: "http://github.com/mattt/")
self.label.addLink(to: url, with: range)
I get this error:
-[UILabel setEnabledTextCheckingTypes:]: unrecognized selector sent to instance 0x147e0aa40
Any ideas what am I missing?