I want to make UILabel
with some text using click-through links. Not links to web pages, but actions like I do with UIButton
. So I used TTTAttributedLabel
, which works great with Objective C
. Now I want to do the same in Swift
, so I wrote the code below:
self.someLabel.text = NSLocalizedString("Lost? Learn more.", comment: "") let range = self.someLabel.text!.rangeOfString(NSLocalizedString("Learn more", comment:"")) self.someLabel.addLinkToURL (NSURL(string:"action://Learn more"), withRange:NSRange (range))
However, I cannot get the link to work in Swift
. I get an error: "Missing argument for parameter 'host' in call"
for the last line.
source share