枚举也是一种类型,类似struct,里面的case类似一个个实例化方法。

enum HistoryAction {
    case request
    case reqestSuccess([String])
    case requestFailure(String)
    case reset
}

HistoryAction.requestHistoryAction.requestSuccess(['a']) 都是 HistoryAction类型