-
-
Save laevandus/6ec720c4021357b7768ff210290d502c 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
enum BrewMethod { | |
case espresso, frenchPress, chemex | |
} | |
// Before | |
func backgroundColor(for method: BrewMethod) -> UIColor { | |
switch method { | |
case .espresso: return .systemBrown | |
case .frenchPress: return .systemCyan | |
case .chemex: return .systemMint | |
} | |
} | |
// After | |
func backgroundColor(for method: BrewMethod) -> UIColor { | |
switch method { | |
case .espresso: .systemBrown | |
case .frenchPress: .systemCyan | |
case .chemex: .systemMint | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment