Last active
February 24, 2021 04:38
-
-
Save akshitzaveri/afaee45f41c0c79b6cd202c45074d9d6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Status { | |
case notStarted | |
case ongoing | |
case ended | |
} | |
enum Team { | |
case first | |
case second | |
} | |
struct Match { | |
let status: Status | |
let team: Team | |
} | |
let match = Match(status: .ongoing, team: .first) | |
switch (match.status, match.team) { | |
case (.notStarted, .first): | |
print("Not Started, first team") | |
case (.notStarted, .second): | |
print("Not Started, second team") | |
case (.ongoing, .first): | |
print("Ongoing, first team") | |
case (.ongoing, .second): | |
print("Ongoing, second team") | |
case (.ended, .first): | |
print("Ended, first team") | |
case (.ended, .second): | |
print("Ended, second team") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment