4

There are so many settings in the preferences for Code->Style->Objective-C. I'm looking for the right one to reformat this line of code

SCPropertyDefinition *test = [SCPropertyDefinition definitionWithName:@"created_at" title:@"Tweeted At" type:SCPropertyTypeLabel];

to this format

SCPropertyDefinition *test = [SCPropertyDefinition definitionWithName:@"created_at" 
                                                                title:@"Tweeted At" 
                                                                 type:SCPropertyTypeLabel];

(the point is to have the colons indention matching)

I guess the it should be in the Wrapping and Braces Tab, but I havn't found the right setting yet. Thanks for your ideas.

qtmfld
  • 2,916
  • 2
  • 21
  • 36
brainray
  • 12,512
  • 11
  • 67
  • 116

2 Answers2

13

The setting you are looking for is Wrapping and Braces | Method call arguments set to Chop down if long with enabled Align by colon. Note that there are separate settings for Method parameters.

Anton Makeev
  • 1,084
  • 9
  • 6
  • It seems like this option was removed from AppCode 2. Or moved, but I can't find it. I wish there was a hotkey to toggle a line between the two formatting forms. – emp Jun 17 '13 at 17:42
  • 2
    No it's still there. You should go to settings->Code Style->Obj-C look for "Method parameters" and change "Do not wrap" to "Wrap always" or "Chop down if long" – Moonkid Oct 11 '13 at 09:40
  • This doesn't work anymore. I can't find any reference to Chop Down if Long in Appcode 3.3. Any alternatives? – John Twigg Dec 30 '15 at 19:00
1

It seems like as of App Code 2017.1 (perhaps earlier too) the align by colon option is not available in Swift. You can still tell App Code to chop a long argument/parameter list:

How to find the chop long line dialog

Mystic
  • 980
  • 1
  • 9
  • 17