协议类型“Any”的值不能符合“Equatable”;只有结构/枚举/类类型可以符合协议
值是类型“ANY”,因为它可以是 Int 或 String。所以无法实现 Equatable 协议。
struct BusinessDetail:Equatable {
static func == (lhs: BusinessDetail, rhs: BusinessDetail) -> Bool {
lhs.cellType == rhs.cellType && lhs.value == rhs.value
}
let cellType: BusinessDetailCellType
var value: Any?
}
enum BusinessDetailCellType:Int {
case x
case y
var textValue:String {
Switch self {
case x:
return "x"
case y:
return "y"
}
}
}