Make Clickable UILabel Using Swift

Solutions Collect From Internet About “Make Clickable UILabel Using Swift”

You can not do with the simple label.

There is library available in the github.

From this you can use the method called yourLabel.addLinkToURL()

class ViewController: UIViewController , TTTAttributedLabelDelegate{

    @IBOutlet var lbl: TTTAttributedLabel!
    override func viewDidLoad() {

        var str : NSString = "Hello this is link"
        lbl.delegate = self
        lbl.text = str as String
        var range : NSRange = str.rangeOfString("link")
        lbl.addLinkToURL(NSURL(string: "")!, withRange: range)

    func attributedLabel(label: TTTAttributedLabel!, didSelectLinkWithURL url: NSURL!) {

enter image description here