title: What is the easiest way to test if an enum-based variable is *not* equal to a specific case with an associated value?
body: <p>We have the following enum and variable</p>
  
  <pre><code>enum DisplayState{
      case loading
      case loaded(ViewModel)
      case noResults
      case error
  }
  
  var displayState:DisplayState = .loading
  </code></pre>
  
  <p>We want to test if we're in any state other than <code>loaded</code>.</p>
  
  <p>Since there is an associated value, this of course doesn't work...</p>
  
  <pre><code>if displayState != .loaded {
      // Do something
  }
  </code></pre>
  
  <p>But I'm hoping to find something else besides either of these...</p>
  
  <pre><code>switch displayState{
      case .loaded: break
      default: // Do something
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if case .loaded = displayState {} else {
      // Do something
  }
  </code></pre>
  
  <p>So what's the simplest way to test for this case?</p>