Enumerations are a great, Swift-specific language feature. Due to their extensibility, what is a simple list of options in another language can have extremely useful additional features. Let’s take a look at how we can add a few to the default enum type: a nice description, a list of all possible values, and a method to choose a random case.
Your new post is loading...