<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XcodeKit",
  "identifier" : "/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "XcodeKit"
    ],
    "preciseIdentifier" : "c:@T@XCSourceEditorCommandDefinitionKey"
  },
  "title" : "XCSourceEditorCommandDefinitionKey"
}
-->

# XCSourceEditorCommandDefinitionKey

A key in the dictionary that defines a source editor command.

```
struct XCSourceEditorCommandDefinitionKey
```

## Overview

Source editor commands are defined via an array of dictionaries under the `XCSourceEditorCommandDefinitions` key of a Xcode Source Editor Extension’s `NSExtensionAttributes` within its `Info.plist` file. Commands can also be specified via the [`commandDefinitions`](/documentation/XcodeKit/XCSourceEditorExtension/commandDefinitions) property in an extension’s conformance to the [`XCSourceEditorExtension`](/documentation/XcodeKit/XCSourceEditorExtension) protocol.

## Topics

### Populating a Command Definition Dictionary

[`static let classNameKey: XCSourceEditorCommandDefinitionKey`](/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey/classNameKey)

The class of the source editor command, in its attributes.

[`static let identifierKey: XCSourceEditorCommandDefinitionKey`](/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey/identifierKey)

The identifier of the source editor command in its attributes.

[`static let nameKey: XCSourceEditorCommandDefinitionKey`](/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey/nameKey)

The name of the source editor command in its attributes.

### Creating a Key Using a Raw String

[`init(rawValue: String)`](/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey/init(rawValue:))

Creates the key for a source-editor command by using the string value you specify.

### Type Properties

[`static let systemSymbolNameKey: XCSourceEditorCommandDefinitionKey`](/documentation/XcodeKit/XCSourceEditorCommandDefinitionKey/systemSymbolNameKey)

An SF Symbol from the system associated with the command.

## Relationships

### Conforms To

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

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

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

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

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

---

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)