Skip to content

Instantly share code, notes, and snippets.

@sauvikatinnofied
Last active January 3, 2017 22:53
Show Gist options
  • Save sauvikatinnofied/b07390e9fc19d1d9c771195261603eae to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/b07390e9fc19d1d9c771195261603eae to your computer and use it in GitHub Desktop.
MediumBlogPost_FontHandling_Gist_4
struct Font {
enum FontType {
case installed(FontName)
// ...
}
enum FontSize {
case standard(StandardSize)
// ...
}
enum FontName: String {
case RobotoBlack = "Roboto-Black"
// ...
}
enum StandardSize: Double {
case h1 = 20.0
// ...
}
// 1
var type: FontType
var size: FontSize
// 2
init(_ type: FontType, size: FontSize) {
self.type = type
self.size = size
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment