Default opening curly braces in Xcode

為{幸葍}努か 提交于 2019-12-24 02:33:24

问题


I am using Xcode, and noticed that Xcode's default auto creation and completion of functions makes opening curly braces go into new lines. For example

(void) this_is_what_xcode_does
{
    // Opening braces on a line of its own - default format
}

I do not like that, I would like the opening braces to be on the same line as the function name. Just like below

(void) this_is_what_i_want_xcode_to_do {
    // Opening braces on the same line as the function - my preferred format
}

How can I change the default Xcode format/behaviour?

Thanks.


回答1:


By default Xcode is missing a good, customisable code formatting settings. You can find some external plugins that are mentioned here. Personally I haven't tried them. So in short, Xcode is missing that feature.

As a side tip I can mention that AppCode has a quite good way to format code in the way you want and the keyboard shortcuts for auto formatting code and optimising imports.



来源:https://stackoverflow.com/questions/25942904/default-opening-curly-braces-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!