<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/removeKeyCommand(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(im)removeKeyCommand:"
  },
  "title" : "removeKeyCommand(_:)"
}
-->

# removeKeyCommand(_:)

Removes the key command from the view controller.

```
func removeKeyCommand(_ keyCommand: UIKeyCommand)
```

## Parameters

`keyCommand`

The key command to remove.

## Discussion

This method lets you easily remove key commands without overriding the [`keyCommands`](/documentation/UIKit/UIResponder/keyCommands) property.

## See Also

[`keyCommands`](/documentation/UIKit/UIResponder/keyCommands)

The key commands that trigger actions on this responder.



---

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)