UIFont
has methods to get regular font (systemFontOfSize
) or bold font (boldSystemFontOfSize
), but how to get a "thin system font" available through storyboard?
Passing "system-thin" to UIFont
Contructor doesn't work, this constructor only works for non system fonts.
You can use system font thin weight:
UIFont.systemFont(ofSize: 34, weight: UIFontWeightThin)
List of available weights for San Francisco:
UIFontWeightUltraLight
UIFontWeightThin
UIFontWeightLight
UIFontWeightRegular
UIFontWeightMedium
UIFontWeightSemibold
UIFontWeightBold
UIFontWeightHeavy
UIFontWeightBlack
As of iOS 11, UIFontWeight*
was renamed to UIFont.Weight.*
. More you can get here https://developer.apple.com/documentation/uikit/uifont.weight.