Last active
September 22, 2021 22:18
-
-
Save elefantel/65c2e08dbf70f135772036de28c862e2 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
protocol Theme { | |
static var isLunoV3Enabled: Bool { get } | |
} | |
/** | |
A theme type that is dynamically determined based on the `isLunoV3Enabled` flag | |
*/ | |
extension Theme { | |
static var color: ThemeColor.Type { | |
isLunoV3Enabled ? LunoThemeColor.self : LegacyThemeColor.self | |
} | |
static var font: ThemeFont.Type { | |
isLunoV3Enabled ? LunoThemeFont.self : LegacyThemeFont.self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment