Re-implement optionals in Swift

In Swift optionals are implemented as enums that contain some or none.

Prerequisites:

  • Some basic understanding of Enum and associated values

Terminology

Optionals: Swift introduced optionals that handle the absence of a value, simply by declaring if there is a value or not. An optional is a type on it’s own!

--

--

stevecurtis.me

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store