X-SwiftFormat
Rui Aureliano · An Xcode source editor extension for formatting Swift code, with an in-app preview and exportable configuration.
About
X-SwiftFormat is a macOS app that provides an Xcode source editor extension for formatting Swift code. It lets you preview formatting in the app and export a .swift-format configuration file for later use.
- Adds a
Format Swift Codecommand to Xcode’s Editor menu after the extension is enabled. - Offers an in-app preview of the formatting operation.
- Exports a
.swift-formatconfiguration file. - Supports assigning a keyboard shortcut to the Xcode command through macOS App Shortcuts.
Install with brew install --cask x-swiftformat. Open X-SwiftFormat once to activate it, then enable it in System Settings under Privacy & Security → Extensions → Xcode Source Editor. In Xcode, run Format Swift Code from the Editor menu. A shortcut can be configured in macOS Keyboard Shortcuts → App Shortcuts, selecting Xcode and using the command name.
The cask requires macOS 13 or later. The project’s instructions separately describe installing Apple’s swift-format; that is a separate tool, not the X-SwiftFormat app itself.
Sources: Project instructions · Homebrew cask
New What’s new in 2.1 Jul 30, 2025 · OpenNavo editorial
- EvidenceEvidence says Version 2.0.1 (250730), not 2.1.