5

I have a weird problem: I have a TTTAttributedLabel with a link in it:

enter image description here

The name "bryan"is the link. When a UIAlertView is presented over this label, the font of the link changes:

enter image description here

As you can see the link lost its font size and weight. Has anyone seen this before? Is there a separate font attribute for "link in background" or something? Thanks.

bcattle
  • 12,115
  • 6
  • 62
  • 82

1 Answers1

13

This happens when you create a link, then set linkAttributes. When the UIAlertController is presented the link becomes "inactive", and it reverts back to a default style. Setting inactiveLinkAttributes fixed this.

Source: https://github.com/TTTAttributedLabel/TTTAttributedLabel/issues/542

bcattle
  • 12,115
  • 6
  • 62
  • 82
  • This literally saved my life. I used [:] for inactiveLinkAttributes as thinking it is not necessary for me. Drove me crazy to find what the problem is when a popover or alertView is presented. Ah man – Daniel Nov 19 '17 at 21:17