Xcode source automatic formatting

后端 未结 19 674
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 16:10

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

19条回答
  •  醉话见心
    2020-11-29 16:31

    I'd like to recommend two options worth considering. Both quite new and evolving.

    ClangFormat-Xcode (free) - on each cmd+s file is reformatted to specific style and saved, easy to deploy within team

    An Xcode plug-in to format your code using Clang's format tools, by @travisjeffery.

    With clang-format you can use Clang to format your code to styles such as LLVM, Google, Chromium, Mozilla, WebKit, or your own configuration.

    Objective-Clean (paid, didn't try it yet) - app raising build errors if predefined style rules are violated - possibly quite hard to use within the team, so I didn't try it out.

    With very minimal setup, you can get Xcode to use our App to enforce your rules. If you are ever caught violating one of your rules, Xcode will throw a build error and take you right to the offending line.

提交回复
热议问题