-
-
Save Juanpe/61eaf2a160cb48786b80189c812cdb55 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
struct Logger { | |
enum LogStyle { | |
case lowercase | |
case uppercase | |
case capitalized | |
} | |
let style: LogStyle | |
func log(_ message: String) { | |
switch style { | |
case .lowercase: | |
print(message.lowercased()) | |
case .uppercase: | |
print(message.uppercased()) | |
case .capitalized: | |
print(message.capitalized) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment