How to use code formatter in Xcode for Swift?

The reformat code command in xcode is Ctrl-I, not Cmd-I and it appears to work just fine.


I write a extension app about format Swift code: Swimat

There has two way to install

  1. brew cask install swimat

  2. Clone this repo, build and restart Xcode.

See https://github.com/Jintin/Swimat for more information

preview


+i: reformat code
Ctrl+i: fix code indentation

Eventhough it has good IntelliSense, xcode sucks at code formatting generally.
Wish it was better.
Apple has to spend so much effort in this in order to make it VS level good.