![Hands-On Design Patterns with Swift](https://wfqqreader-1252317822.image.myqcloud.com/cover/72/36699072/b_36699072.jpg)
上QQ阅读APP看书,第一时间看更新
Simple enums
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.