Xcode code formatter Swift
I'm trying to auto format my code written in Swift. It's necessary if you're working in team and using CVS and don't want to merge for hours.
Ctrl+I just makes an indent, but for example i want to have proper space between functions and just all the stuff like in Clang.
The reformat code command in xcode is Ctrl-I, not Cmd-I and it appears to work just fine.
⌃+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.
SwiftFormat is a popular code formatter for swift. It has an extension for Xcode, which can be accessed from the
Editor
menu.Quote from the SwiftFormat readme: