As a C# developer, I have become highly dependent on the automatic formatting in Visual Studio 2008. Specifically, I will use the CTRL + K , D
I also feel xcode should have this function. So I made an extension to do it: Swimat
Simple install by brew cask install swimat
brew cask install swimat
You can give it a try, see https://github.com/Jintin/Swimat for more information.