- Hands-On Design Patterns with Swift
- Florent Vilmart Giordano Scalzo Sergio De Simone
- 62字
- 2021-07-02 14:44:58
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.
推薦閱讀
- Python數(shù)據(jù)挖掘:入門、進(jìn)階與實(shí)用案例分析
- 業(yè)務(wù)數(shù)據(jù)分析:五招破解業(yè)務(wù)難題
- 數(shù)據(jù)結(jié)構(gòu)與算法(C語(yǔ)言版)
- Remote Usability Testing
- 數(shù)據(jù)庫(kù)技術(shù)實(shí)用教程
- 大數(shù)據(jù)架構(gòu)商業(yè)之路:從業(yè)務(wù)需求到技術(shù)方案
- 高維數(shù)據(jù)分析預(yù)處理技術(shù)
- PostgreSQL指南:內(nèi)幕探索
- 編寫(xiě)有效用例
- 淘寶、天貓電商數(shù)據(jù)分析與挖掘?qū)崙?zhàn)(第2版)
- Oracle高性能SQL引擎剖析:SQL優(yōu)化與調(diào)優(yōu)機(jī)制詳解
- Visual FoxPro數(shù)據(jù)庫(kù)技術(shù)基礎(chǔ)
- 數(shù)據(jù)會(huì)說(shuō)話:活用數(shù)據(jù)表達(dá)、說(shuō)服與決策
- 敏捷數(shù)據(jù)分析工具箱:深入解析ADW+OAC
- 實(shí)用數(shù)據(jù)結(jié)構(gòu)基礎(chǔ)(第四版)