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 Enumerations and Optionals in Swift Objects and Optionals Pattern Matching With Enums

Johnny Nguyen
Johnny Nguyen
3,875 Points

I don't understand the last one.

Where is ".some(let x)"?

1 Answer

Heidi Puk Hermann
Heidi Puk Hermann
33,366 Points

.some comes from the definition of optionals in Swift. If you read the documentation, you will find that an optional actually is an enum with two cases; some and none, where some is the case when there is a value and none is the case when the optional is nil.

You can read more here: Apple developer documentation: optionals an here: Apple library - optionals