【发布时间】:2017-04-03 19:04:38
【问题描述】:
如何在忽略关联值的同时检查枚举的大小写?
以下是我使用的,但它给出了一个错误...
enum Example {
case one(value: String)
case two(otherValue: Int)
}
var test = Example.one(value: "A String")
if test == Example.one { // Gives Error
// Do Something
}
重复问题过于复杂。
【问题讨论】: