How to make a Swift enum with associated values equatable
问题 I have an enum of associated values which I would like to make equatable for testing purposes, but do not know how this pattern would work with an enum case with more than one argument. For example, summarised below I know the syntax for making heading equatable. How would this work for options, which contains multiple values of different types? enum ViewModel { case heading(String) case options(id: String, title: String, enabled: Bool) } func ==(lhs: ViewModel, rhs: ViewModel) -> Bool {