<!--
{
  "availability" : [
    "iOS: 3.0.0 - 16.0.0",
    "iPadOS: 3.0.0 - 16.0.0",
    "macCatalyst: 13.1.0 - 16.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIMenuController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIMenuController"
  },
  "title" : "UIMenuController"
}
-->

# UIMenuController

The menu interface for the Cut, Copy, Paste, Select, Select All, and Delete commands.

```
@MainActor class UIMenuController
```

## Overview

The singleton [`UIMenuController`](/documentation/UIKit/UIMenuController) instance is referred to as the editing menu. When you make this menu visible, [`UIMenuController`](/documentation/UIKit/UIMenuController) positions it relative to a target rectangle on the screen; this rectangle usually defines a selection. The menu appears above the target rectangle or, if there isn’t enough space for it, below it. The menu’s pointer is placed at the center of the top or bottom of the target rectangle, as appropriate. Be sure to set the tracking rectangle before you make the menu visible. You’re also responsible for detecting, tracking, and displaying selections.

The [`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions) informal protocol declares methods that are invoked when the user taps a menu command. The [`canPerformAction(_:withSender:)`](/documentation/UIKit/UIResponder/canPerformAction(_:withSender:)) method of [`UIResponder`](/documentation/UIKit/UIResponder) is also related to the editing menu. A responder implements this method to enable and disable commands of the editing menu just before the menu is displayed. You can force the menu commands enabled state to update by calling the [`update()`](/documentation/UIKit/UIMenuController/update()) method.

You can also provide your own menu items via the [`menuItems`](/documentation/UIKit/UIMenuController/menuItems) property. When you modify the menu items, you can use the [`update()`](/documentation/UIKit/UIMenuController/update()) method to force the menu to update its display.

## Topics

### Getting the menu controller instance

[`sharedMenuController`](/documentation/UIKit/UIMenuController/shared)

Returns the menu controller.

### Showing and hiding the menu

[`-  showMenuFromView:rect:`](/documentation/UIKit/UIMenuController/showMenu(from:rect:))

[`-  hideMenuFromView:`](/documentation/UIKit/UIMenuController/hideMenu(from:))

[`-  hideMenu`](/documentation/UIKit/UIMenuController/hideMenu())

[`menuVisible`](/documentation/UIKit/UIMenuController/isMenuVisible)

The visibility of the editing menu.

[`-  setMenuVisible:animated:`](/documentation/UIKit/UIMenuController/setMenuVisible(_:animated:))

Shows or hides the editing menu, optionally animating the action.

### Positioning the menu

[`menuFrame`](/documentation/UIKit/UIMenuController/menuFrame)

Returns the frame of the editing menu.

[`arrowDirection`](/documentation/UIKit/UIMenuController/arrowDirection-swift.property)

The direction the arrow of the editing menu is pointing.

[`ArrowDirection`](/documentation/UIKit/UIMenuController/ArrowDirection-swift.enum)

The direction the arrow of the editing menu is pointing.

[`-  setTargetRect:inView:`](/documentation/UIKit/UIMenuController/setTargetRect(_:in:))

Sets the area in a view above or below which the editing menu is positioned.

### Updating the menu

[`-  update`](/documentation/UIKit/UIMenuController/update())

Updates the appearance and enabled state of menu commands.

### Customizing menu items

[`menuItems`](/documentation/UIKit/UIMenuController/menuItems)

The custom menu items for the editing menu.

### Notifications

[`UIMenuControllerWillShowMenuNotification`](/documentation/UIKit/UIMenuController/willShowMenuNotification)

Posted by the menu controller just before it shows the menu.

[`UIMenuControllerDidShowMenuNotification`](/documentation/UIKit/UIMenuController/didShowMenuNotification)

Posted by the menu controller just after it shows the menu.

[`UIMenuControllerWillHideMenuNotification`](/documentation/UIKit/UIMenuController/willHideMenuNotification)

Posted by the menu controller just before it hides the menu.

[`UIMenuControllerDidHideMenuNotification`](/documentation/UIKit/UIMenuController/didHideMenuNotification)

Posted by the menu controller just after it hides the menu.

[`UIMenuControllerMenuFrameDidChangeNotification`](/documentation/UIKit/UIMenuController/menuFrameDidChangeNotification)

Posted when the frame of a visible menu changes.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)