title: KVC - check if the property exist
body: <p>Using Key Value Coding.<br />
  How do I write to check if the property exist?</p>
  <pre><code>let prop = state.value(forKey: &quot;prop&quot;) as! Double
  </code></pre>
  <p>I tried the following code.</p>
  <pre><code>if !state.responds(to: Selector(&quot;getProp&quot;)) { ... } // always false
  if state.value(forKey: &quot;prop&quot;) != nil { ... } // the app crashed with 'NSUnknownKeyException' exception
  </code></pre>