Enum raw value
They are the values by which the enum is pre-populated.
Eg enum ControlCharacter:Character {
case tab = "\t"
case return = "\r"
}
In this enum tab has the default value of "\t"
If you dont specify any raw value swift will automatically assign values
Eg enum Direction:String {
case north, south, east, west
}
Here Direction.east has a default raw value east.
Comments
Post a Comment