Kieran
Kieran

Reputation: 87

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

Upvotes: 0

Views: 632

Answers (1)

Ron.Kliffer
Ron.Kliffer

Reputation: 248

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)

Upvotes: 1

Related Questions