December 2018
Intermediate to advanced
414 pages
10h 19m
English
Let's say you're building a smart light remote control; you can easily represent the state of this light with the following enum:
enum State { case on case off}let anOnLight = State.on
This is a very simple example, and we could have used a Boolean value, but with the enum, we set ourselves up for expansion.
Read now
Unlock full access