Trim trailing spaces in Xcode

后端 未结 7 2107

Is there a way to force Xcode to trim trailing whitespaces when I save file?

I\'m using version 3.1.3 if that matters.

7条回答
  •  温柔的废话
    2021-01-30 01:23

    For Xcode 8, I installed the swimat Xcode plug-in, for formatting Swift code, which removed all trailing spaces and whitespace-only lines.

    Installation Methods

    1. Install via homebrew-cask:

      brew cask install swimat
      
    2. Download the App directly:
      https://github.com/Jintin/Swimat/releases/download/v1.3.5/Swimat.zip

    3. Clone extension branch and archive to Mac App.

    Usage

    Once installed, you can run Swimat in Xcode via Editor -> Swimat -> Format.

提交回复
热议问题