iOS ● ○ ○ Swift 6

Kodebits Day 89: Enum Raw Values

Sep 9 2026
Practice enums with a short swift challenge.

What is the output?

enum Status: Int {
  case pending = 1
  case active = 5
  case done = 10
}
let s = Status.active
print(s.rawValue)
print(Status.done.rawValue)


Try it in the online Swift Playground →

[spoiler title="Solution"]

Answer:

5
10

Explanation:

Raw values provide underlying primitive values for enum cases.

[/spoiler]


Further Reading