Collin O. Collin O. - 1 year ago 187
iOS Question

How to Change Font Style in Swift

I'm trying to figure out how to change the style of a font to "Thin". Does anyone know how to do this?

Here's my best try, but it doesn't work:

m.font = UIFont(name: "Apple SD Gothic Neo", style: "Thin", size: 8.0)

Answer Source

The way I have seen it is AppleSDGothicNeo-Thin, No spaces, and a dash style. So your code would be

m.font = UIFont(name: "AppleSDGothicNeo-Thin", size: 8.0)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download