title: Most optimal way to increment or initialize an Int in a Swift Dictionary
body: <p>Given a directory and a key, I want to increment the value of that key if it exist in the dictionary, or initialize it to 1.</p>
  
  <p>The dictionary type is Dictionary, but by design the value type for this key will always be an Int since it would only be changed by this code.</p>
  
  <p>The code I have so far is below, but would like to optimize it, in swift style.</p>
  
  <pre><code>let v = dict[key] as? Int
  if v != nil {
      dict[key] = v! + 1
  } else {
      dict[key] = 1
  }
  </code></pre>