Swift 2 if case syntax with enum having associated values
<p>I'm stuck with some really simple syntax I guess, but I can't find how to solve it.</p>

<ul>
<li><p>First of all here's the setup, let me introduce a nice enum with multiple associated values</p>

<pre><code>enum Entity {
    case City(data: CityData, position: NSRange)
    case Date(date: NSDate)
    case Service
}
</code></pre></li>
<li><p>Then I would like to check if a field of some dictionary is a city and if it is, deal with its data and position... The only way I could manage is <em>via</em> a <code>switch</code>!!!</p>

<pre><code>if let city = result["ABC"] {
    switch city {
    case .City(data:let data, position:let position): // Do something with data and position
    default: // Do nothing
    }
}
</code></pre></li>
</ul>

<p>And I was wondering if the <code>if case</code>syntax could be of any help...</p>

<p>But I could not find it (may be the tiredness, I hope...)</p>

<p>I'm looking for something like that:</p>

<pre><code>if case result["ABC"] == .City(data:let data, position:let position) { 
    // Do something with data and position
}
</code></pre>

<p>So I'm sure it's obvious, but I've missed it... So if you can help, that would be great.</p>

<p>Thanks in advance.</p>