iosuialertviewnsattributedstringtttattributedlabel

TTTAttributedLabel link font changing when UIAlertView presents


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.


Solution

  • 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