2

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.

Greeso
  • 7,544
  • 9
  • 51
  • 77
  • 2
    Just be thankful you're not using Visual Studio. – Hot Licks Sep 19 '14 at 22:21
  • 3
    @HotLicks - As a matter of fact, Visual Studio is far better IDE than Xcode. I use Xcode, Visual Studio, and Eclipse, and I am neither an "Apple guy" or a "Windows guy"; I do not identify myself by a product, but truth is, Visual Studio is way better than Xcode. – Greeso Sep 20 '14 at 01:07

1 Answers1

2

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.

Community
  • 1
  • 1
Julian
  • 9,299
  • 5
  • 48
  • 65