Xcode: Adjusting indentation of auto-generated braces?

前端 未结 6 1282
遥遥无期
遥遥无期 2020-12-07 17:37

Code auto-generated by Xcode seems to have the opening brace on the same line by default:

@interface Controller : NSObject {

}

I\'d like t

6条回答
  •  天命终不由人
    2020-12-07 18:30

    If you want to have your preferred style in all situations, you need a combination of Laughing_Jack's answer and Peter Hosey's answer. In addition to what Peter Hosey said, you may also like to know that the Cocoa Touch file templates are in the following location. You can copy that directory to your custom templates too:

    /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/File Templates/Cocoa Touch Classes/
    

    The Xcode User Defaults give you your style when typing out code by hand, the file templates provide it when auto-generating a new class etc.

提交回复
热议问题