ranesr / SwiftIcons

🎢Swift Library for Font Icons - ★ this library

Home Page:https://ranesr.github.io/SwiftIcons/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bold font not staying

marcheimendinger opened this issue · comments

I have a UILabel which sometimes has an icon and sometimes not. By default the label is set with a bold font in the Storyboard and at the launch it does not contains any icon (the text is simply set with label.text).

If I apply the icon and the text with .setIcon(), the first time the bold attribute will stay but if I run .setIcon() a second time to update the text content, the font will be overwritten with the standard one, being not bold.

The only workaround I found is to store in a variable during viewDidLoad() the original bold font and before each execution of .setIcon() I re-set the original font with label.font = initialLabelFont.