How to make Xcode put starting brace on new line in Swift?

家住魔仙堡 提交于 2019-12-01 03:35:17

You can use below methods in conjusction to acomplish this task.

Snippet Edit

Snippet Edit is a small program that is used to edit the Xcode's standard code snippets. We have to do this way because there is no direct way to change the code style in Xcode settings and XCCodeSenseFormattingOptions is not supported since Xcode 4

You can follow below screenshot for reference. Remember to restart Xcode once you are done with editing.

ClangFormat and Uncrustify

Above method will only change the default statement templetes and not the inbuilt methods formatting. (i.e autofilled viewDidLoad() method will still have the braces in the same line.) For this you should consider using these plugins. They have options to save the file with specified format.

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