title: Swift: NSNumber is not a subtype of UIViewAnimationCurve
body: <p>How do I get the line below to compile?</p>
  
  <pre><code>UIView.setAnimationCurve(userInfo[UIKeyboardAnimationCurveUserInfoKey].integerValue)
  </code></pre>
  
  <p>Right now, it gives the compile error:</p>
  
  <pre><code>'NSNumber' is not a subtype of 'UIViewAnimationCurve'
  </code></pre>
  
  <p>Why does the compiler think <code>userInfo[UIKeyboardAnimationCurveUserInfoKey].integerValue</code> is an <code>NSNumber</code> when <code>integerValue</code> is declared as an <code>Int</code>?</p>
  
  <pre><code>class NSNumber : NSValue {
      // ...
      var integerValue: Int { get }`?
      // ...
  }
  </code></pre>
  
  <p>I've had similar issues with other enum types. What is the general solution?</p>