-
-
Save cipolleschi/9c77c90e0b2b8203fd2bd89c7b10c7e8 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
| let myPet: Pet = .dog(breed: .siberianHusky) | |
| switch myPet { | |
| case .dog(let dog): | |
| switch dog { | |
| case .siberianHusky: | |
| print("I have a Husky!") | |
| case .germanSheperd: | |
| print("I have a German Sheperd!") | |
| } | |
| case .cat(let cat): | |
| switch cat { | |
| case .siamese: | |
| print("I have a Siamese Cat!") | |
| case .abyssian: | |
| print("I have an Abyssian Cat !") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment