Created
April 9, 2018 15:22
-
-
Save raonivaladares/19c9516499938cbc81dc94b8d625c86e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIFont { | |
enum FontStyle { | |
case bold | |
case book | |
case light | |
case regular | |
} | |
static func defaultAppFonts(style: TextStyle, size: CGFloat) -> UIFont { | |
var name: String | |
switch style { | |
case .bold: name = "Gotham-Bold" | |
case .book: name = "Gotham-Book" | |
case .light: name = "Gotham-Light" | |
case .regular: name = "Gotham-Regular" | |
} | |
return UIFont(name: name, size: size) ?? UIFont.systemFont(ofSize: size) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment