Sunday 15 April 2012

ios - didSelectLinkWithURL not getting called with TTTAttributedLabel -


So I'm using the fastest TTTTLLB and I (I think) have installed everything properly. Calling didSelectLinkWithURL is not being made, and I do not know why the link appears in the "Highlight" label - so I do not think I'm setting it up incorrectly

< P> This is my code:

  Import UIKit class ViewController: UIViewController, TTTAttributedLabelDelegate {@IBOutlet weak var label: TTTAttributedLabel! Override FunctionDidload () {super.viewDidLoad () var str: NSString = label.text! Rng: NSRange = str.rangeOfString ("fox") label.addLinkToURL (string: "http://apple.com"), with Range: RNG)} func attributedLabel (label: TTA distributed label !, didSelectLinkWithURL url: NSURL !) {Println ("test123")}}  

Any ideas? Thanks :)

add line label.delegate = self


No comments:

Post a Comment