---
title: XCSourceEditorCommand
framework: XcodeKit
role: symbol
role_heading: Protocol
platforms: [macOS 10.12+]
path: xcodekit/xcsourceeditorcommand
---

# XCSourceEditorCommand

The protocol you implement to handle command invocations in a source editor extension.

## Declaration

```swift
protocol XCSourceEditorCommand : NSObjectProtocol
```

## Mentioned in

Creating a Source Editor Extension

## Overview

Overview A one-to-one mapping between command classes and commands is not required—multiple commands can be handled by a single class, by checking their invocation’s commandIdentifier at runtime.

## Topics

### Defining Editor Commands

- [XCSourceEditorCommandDefinitionKey](xcodekit/xcsourceeditorcommanddefinitionkey.md)

### Handling Editor Commands

- [perform(with:completionHandler:)](xcodekit/xcsourceeditorcommand/perform(with:completionhandler:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Editor Commands

- [XCSourceEditorCommandInvocation](xcodekit/xcsourceeditorcommandinvocation.md)
