Before iOS 9 to reference fonts we used fontWithName
of UIFont
:
[UIFont fontWithName:@"HelveticaNeue" size:18]
Now we're moving to iOS 9. How to reference a new San Francisco font in the same way?
We can use it with systemFontOfSize
of UIFont
, but how to reference styles other than regular? For example, how to use San Francisco Medium or San Francisco Light fonts?
Swift 4
In iOS 9 it is the system font, so you could do:
You can use the font name directly, but I don't think this is safe:
You can also create the font with specific weight, like so:
or