Joa*_*son 24
swiftlint has an autocorrect option that will fix some issues for you, so when I get trailing whitespace warnings I run swiftlint from the command line in my project
$ swiftlint autocorrect
Run Code Online (Sandbox Code Playgroud)
Update
As of version 0.43 autocorrect has been deprecated and replaced with --fix so now the command is
$ swiftlint --fix
Run Code Online (Sandbox Code Playgroud)
autocorrect is still available for the time being, for more info see the change log
小智 12
要修复现有(从中删除尾随空白)纯空白行,按照 rmaddy 的建议打开首选项 include-whitespace-only-lines 后,可以选择全部,复制整个文件,然后粘贴,用相同的内容替换所有文本文本。Xcode 将在粘贴的代码上应用首选项。