Junior — Middle
To which category of data does the Enum type belong?
sobes.tech AI
Answer from AI
The Enum type in iOS (Swift) belongs to the category of enumerated types (enumerations). It is a user-defined type that specifies a set of related values under a single name.
Enums allow working with a limited set of options, making the code more readable and safe.
Example:
enum Direction {
case north
case south
case east
case west
}
let dir: Direction = .north
Thus, an Enum is a data type that represents a discrete set of values, often used for modeling states or options.