Reputation: 1870
I just upgraded to Swift 3. I created a TTTAttributedLabel with a clickable URL, unfortunately the delegate function does not work anymore. Anyone has similar problems?
func attributedLabel(_ label: TTTAttributedLabel!, didSelectLinkWith url: URL!) {
}
Upvotes: 2
Views: 2153
Reputation: 3006
extension YourViewController: TTTAttributedLabelDelegate {
func attributedLabel(_ label: TTTAttributedLabel!, didSelectLinkWith url: URL!) {
UIApplication.shared.openURL(url)
}
}
Upvotes: 0
Reputation: 197
Did you remember to connect the delegate?
label.delegate = self
It is working for me
Upvotes: 2