Enums: A Fixed Set of Choices

A fixed set of choices

A PawWalk user is an owner or a walker. Not both, not "ownerr" with a typo, not some surprise third thing. When a value can only be one of a known, fixed set of choices, Swift gives you the enum (enumeration).

You declare the choices as cases. A value of the type is exactly one case: let role = UserRole.owner. And when Swift already knows the type, you can use the beloved dot shorthand: let role: UserRole = .owner.