-
-
Save laevandus/e81a8a55710cfd1abaf2ade294e8c48a 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 State { | |
case loading | |
case error(Error) | |
case view | |
} | |
func logState() { | |
switch state { | |
case .loading: | |
print("Showing loading view") | |
case .error: // or case .error(_): | |
print("Showing error view") | |
case .view: | |
print("Showing content view") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment