Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 4, 2021 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/12ac3796f98ae70811275243556fb9a0 to your computer and use it in GitHub Desktop.
Save sturdysturge/12ac3796f98ae70811275243556fb9a0 to your computer and use it in GitHub Desktop.
enum WeightType: String, CaseIterable {
case black, bold, heavy, light, medium, regular, semibold, thin, ultraLight
var weight: Font.Weight {
switch self {
case .black:
return .black
case .bold:
return .bold
case .heavy:
return .heavy
case .light:
return .light
case .medium:
return .medium
case .regular:
return .regular
case .semibold:
return .semibold
case .thin:
return .thin
case .ultraLight:
return .ultraLight
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment