How to use code formatter in Xcode for Swift?

S. Birklin picture S. Birklin · Nov 18, 2014 · Viewed 62.8k times · Source

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.

Answer

CuriousRabbit picture CuriousRabbit · Nov 23, 2014

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