Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Chirs Mendenhall
Chirs Mendenhall
4,392 Points

key words "default and case?"

im a little confused with the key words "default and Case" . you showed them in this video but did not explain how they work and why you used them. Did i miss something??

1 Answer

rico petrini
rico petrini
522 Points

cases are just names for the witch statement and the switch is the value that you want to execute for example var billy = bob switch billy { case "billy": print("this case matches the switch statement value now this will be printed") default: print("if none of the cases match the switch value then this will be printed") }