Enumeration
Enumeration
Introduction
Hello,
In this lesson, we will learn the subject of Enumeration.
Enumeration is used to create user-defined types. In the next step, working with this user-defined associated data allows us to write code with high type security.
Enums are types of value used to hold data belonging to a related group together. It allows us to work with type security in codes.
cont.
There is some information we need to know about enums. Let's list them.
- In Swift, every casein in my enum does not have to have a value.
- The raw values assigned to the casings in the enum can be a String, Character, integer, or floating-point type.
- We can define AssociatedValue in Enum. These defined values can be of any type.
- It is a first-class type in Enumeration Swift.