<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.2 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTouchBar/escapeKeyReplacementItemIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTouchBar(py)escapeKeyReplacementItemIdentifier"
  },
  "title" : "escapeKeyReplacementItemIdentifier"
}
-->

# escapeKeyReplacementItemIdentifier

The identifier of an item that replaces the system-provided button in the Touch Bar.

```
var escapeKeyReplacementItemIdentifier: NSTouchBarItem.Identifier? { get set }
```

## Discussion

To replace the system-provided button, set [`escapeKeyReplacementItemIdentifier`](/documentation/AppKit/NSTouchBar/escapeKeyReplacementItemIdentifier) to the identifier of an [`NSTouchBarItem`](/documentation/AppKit/NSTouchBarItem) instance. You must also include the item instance in the Touch Bar’s [`templateItems`](/documentation/AppKit/NSTouchBar/templateItems) array, or return the item when the Touch Bar calls the [`touchBar(_:makeItemForIdentifier:)`](/documentation/AppKit/NSTouchBarDelegate/touchBar(_:makeItemForIdentifier:)) delegate method.

Devices that include the Touch Bar (second generation) have a dedicated Escape key located to the left of the Touch Bar. By default, the Touch Bar hides the system-provided button and its replacement on these devices. However, if you set the replacement item’s [`visibilityPriority`](/documentation/AppKit/NSTouchBarItem/visibilityPriority) to [`high`](/documentation/AppKit/NSTouchBarItem/Priority/high), the Touch Bar shows the item and reduces the visible space of the app region.

---

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)