<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/keyboardAnimationCurveUserInfoKey",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@UIKeyboardAnimationCurveUserInfoKey"
  },
  "title" : "keyboardAnimationCurveUserInfoKey"
}
-->

# keyboardAnimationCurveUserInfoKey

A user info key to retrieve the animation curve that the system uses to animate the keyboard onto or off the screen.

```
nonisolated class let keyboardAnimationCurveUserInfoKey: String
```

## Discussion

The value for this key is an <doc://com.apple.documentation/documentation/Foundation/NSNumber> object that contains a [`UIView.AnimationCurve`](/documentation/UIKit/UIView/AnimationCurve) constant used to determine how the system animates the keyboard onto or off the screen. You can use this value to match the animation of the keyboard in your own animations.

Before using this value, convert the animation curve constant to [`UIView.AnimationOptions`](/documentation/UIKit/UIView/AnimationOptions), which you can pass to one of UIKit’s animation methods, such as [`animate(withDuration:animations:completion:)`](/documentation/UIKit/UIView/animate(withDuration:animations:completion:)).

```swift
// Get the animation curve constant and the duration for your animation.
guard let animationCurve = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? UInt,
      let animationDuration = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double else { return }

// Convert the animation curve constant to animation options.
let animationOptions = UIView.AnimationOptions(rawValue: animationCurve << 16)

// Perform your animation.
UIView.animate(withDuration: animationDuration,
               delay: 0,
               options: animationOptions) {
    // Specify what to animate. For example, calling layoutIfNeeded animates a change to
    // the view's constraints.
    self.view.layoutIfNeeded()
} completion: { _ in
    // Use the completion handler to perform anything that needs to happen after the keyboard
    // frame finishes animating, such as scrolling your text view after the animation completes.
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)