Questions tagged [tttattributedlabel]

TTTAttributedLabel is "a drop-in replacement for UILabel that supports attributes, data detectors, links, and more".

TTTAttributedLabel is "a drop-in replacement for UILabel that supports attributes, data detectors, links, and more".

Further links:

78 questions
3
votes
1 answer

didSelectLinkWithURL not getting called with TTTAttributedLabel

So I'm using TTTAttributedLabel in swift and I (think I) have everything set up properly. didSelectLinkWithURL is not getting called, and I have no idea why. The link "highlight" shows up in the label - so I don't think I'm setting it up wrong.…
mlevi
  • 1,433
  • 3
  • 18
  • 30
3
votes
1 answer

TTTAttributedLabel link detection not working using Storyboard

I am trying to integrate TTTAttributedLabel into a UITableViewCell. It's really just a simple integration and all I wanted to was to substitute the old UILabel with TTTAttributedLabel. Here's what I did. Go to Storyboard and select the UILabel…
Vlad
  • 8,038
  • 14
  • 60
  • 92
3
votes
2 answers

How do I use TTTAttributedLabel to add "Read more"

I have to display a small portion of a long text in objective C.how we will use TTTAttributedLabel to add a Read More button to display all text. Thanks in advance
3
votes
1 answer

TTTAttributedLabel "Read More >" tail truncation with several attributes possible?

TTTAttributedLabel support a custom truncation string via truncationTokenString as well as truncationTokenStringAttributes. However, I am wanting to go a bit further and set several string attributes on the truncation string, including different…
runmad
  • 14,846
  • 9
  • 99
  • 140
3
votes
3 answers

iPhone -Remove the underline from link in UILabel

I am using TTTAttributedLabel (https://github.com/twotoasters/TTTAttributedLabel). Here I'm correctly getting the label with some clickable text. I need to display my text like the username in above image(ie. without underline).How could I do that?
nithin
  • 2,457
  • 1
  • 30
  • 50
2
votes
1 answer

Unable to subclass UILabel: Unrecognized selector sent to UILabel

I'm using CocoaPods to import some things. Right now I'm trying to use TTTAttributedLabel, which is a rich subclass of UILabel, allowing for URL-clicking etc. Now, I'm having trouble getting my app to recognise that my labels are actually instances…
Sti
  • 8,275
  • 9
  • 62
  • 124
2
votes
2 answers

TTTAttributedLabel clickable link does not work in Swift 3

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:…
dickyj
  • 1,830
  • 1
  • 24
  • 41
2
votes
2 answers

Get text part of clicked URL in TTTAttributedLabel

I need the text of clicked part of TTTAttributedLabel: // initialize - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ... // Attributed Message Label NSMutableAttributedString…
Soheil Novinfard
  • 1,358
  • 1
  • 16
  • 43
2
votes
0 answers

swift how to get height using font at UILabel

I am using TTTAttributedLabel and UIFont(name: "HelveticaNeue-Medium", size: 12.0) now. To get height string, i made this function. self.font = UIFont(name: "HelveticaNeue-Medium", size: 12.0) let constraintRect = CGSize(width:…
zhang
  • 21
  • 3
2
votes
1 answer

TTTAttributedLabel add action to truncation ("Read more" text)

I can show "... Read more" in UILabel using TTTAttributedLabel. [lblContent setAttributedTruncationToken:str]; But I need to trigger another action when user tap on that text. I try to modify inside TTTAttributedLabel and it is not okay. How shall…
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
2
votes
1 answer

How to add NSDictionary UIColor in iOS for TTTAttributedLabel LinkAttributes

I have using a Xamarin binding for https://github.com/TTTAttributedLabel/TTTAttributedLabel And as per - Make link in UILabel.attributedText *not* blue and *not* underlined self.label.linkAttributes = @{NSForegroundColorAttributeName: color, …
WickedW
  • 2,331
  • 4
  • 24
  • 54
2
votes
0 answers

Is it possible to set link attributes using UIAppearance on TTTAttributedLabel?

I'm tying to create a TTTAttributedLabel wrapper in order to provide UIAppearance support for linkAttributes and activeLinkAttributes properties among other stuff (i.e custom links) As the interface @interface MYLabel : TTTAttributedLabel @property…
Omer
  • 5,470
  • 8
  • 39
  • 64
2
votes
1 answer

How to make TTTAttributedLabel vertically align center with truncated tail

I am using TTTAttributedLabel to display some text vertically centered (default in both TTTAttributedLabel and UILabel), with a single line (also default), and truncated tail line breaking. TTTAttributedLabel *label1 = [[TTTAttributedLabel alloc]…
Ric Santos
  • 15,419
  • 6
  • 50
  • 75
2
votes
1 answer

How to reduce length of links OR set a fixed length for links detected in TTTAttributedLabel

The links pasted by users are very long and contain "http://" etc and hence I want to restrict the length of links and show only the main website name or a bit more than that. Example: Link pasted by user: …
2
votes
3 answers

How can I use ASTextNode with TTTAttributedLabel

I have built a ASCellNode and it works perfectly. However when I used a traditional UICollectionViewCell I used an TTTAttributedLabel with links. I don't know how should I replicate this with AsyncDisplayKit I can assign the attriubtedText from the…