枚举也是一种类型,类似struct,里面的case类似一个个实例化方法。
enum HistoryAction { case request case reqestSuccess([String]) case requestFailure(String) case reset }
HistoryAction.request 和 HistoryAction.requestSuccess(['a']) 都是 HistoryAction类型
HistoryAction.request
HistoryAction.requestSuccess(['a'])