Post

Replies

Boosts

Views

Activity

Reply to guarding on enum value
Instead of extending Equatable, you can just have RawValue and compare it. For example: enum E: String { case A, B, C(Int) var rawValue: String { if case .C(let something) = self { return "c_\(something)" } return String(describing: self) } } And than you can compare: if A.rawValue != B.rawValue { ... }
Feb ’23