title: How to make a Swift enum with associated values equatable
body: <p>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.</p>
  
  <p>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?</p>
  
  <pre><code>enum ViewModel {
      case heading(String)
      case options(id: String, title: String, enabled: Bool)
  }
  
  func ==(lhs: ViewModel, rhs: ViewModel) -&gt; Bool {
      switch (lhs, rhs) {
      case (let .heading(lhsString), let .heading(rhsString)):
          return lhsString == rhsString
      case options...
      default:
          return false
      }
  }
  </code></pre>
  
  <p>I know Swift 4.1 can synthesize conformance for Equatable for us, but at present I am not able to update to this version.</p>