Search code examples
uitableviewswiftxcode6uifonttextlabel

changing UITableViewCell text font


I was able to change the font of the tableViewCell text using this code

    cell.textLabel?.font = UIFont(name: "Snell Roundhand", size: 40)

However i would also like to make this font bold, so far I've tried to do this by using this code cell.textLabel?.font = UIFont.boldSystemFontOfSize(40)

Although this does change the font to be bold, it also changes the font back to the standard one and not "Snell Roundhand".

Any idea on why this is? and how to resolve this?

Many thanks Kieran


Solution

  • You're using the regular font name. To use the bold variation of the font, use this code:

    cell.textLabel?.font = UIFont(name: "SnellRoundhand-Bold", size: 40)