Xcode source automatic formatting

后端 未结 19 678
佛祖请我去吃肉
佛祖请我去吃肉 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:35

    I suggest using ClangFormat. In order to install, please follow these steps:

    1. Install Alcatraz package manager for XCode Supports Xcode 5+ & OS X 10.9+
    2. After installation restart XCode.
    3. Open XCode -> Window Menu -> Package Manager
    4. Search (find) ClangFormat and install it. After installation again restart XCode.
    5. Now at XCode menu you can use Edit -> Clang Format submenu for formatting.

    You can choose different types of formatting. Also by enabling Format On Save you can gain auto-format capability.

提交回复
热议问题