Enum are new types introduced in Swift to group set of constant values under a single name.

It helps developer to have type safety.

Let’s see how to create an enum.

Enum is created with enum keyword in swift

    case VALUE,
    case VALUE

Here is an example

enum Weekend{
    case SATURDAY
    case SUNDAY


Weekend is new user custom type which we can create a variables. It contains SATURDAY and SUNDAY values.

Enum types name always captilized similar to classes in Swift

How to iterate Enum type values.