kodecocodes / objective-c-style-guide

A style guide that outlines the coding conventions for Kodeco
http://www.raywenderlich.com/62570/objective-c-style-guide
3.1k stars 628 forks source link

How do I indent something like this??? #75

Open liuzhen2008 opened 7 years ago

liuzhen2008 commented 7 years ago

I just started writing objective c recently. This indentation is crazy.

How do I deal with something like this?

Note that this "alert" variable is already nested under 3 levels. So xocd automatically tries to wrap text if too long.

Where do i start a new line? where should the message:@"" start?


                UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Broadcast Invite"
                                                                               message:@"Do you want to join??."
                                                                        preferredStyle:UIAlertControllerStyleAlert];
funkyboy commented 7 years ago

That's the "standard" way. You can use 2 spaces indentation to "ease the pain" :)

liuzhen2008 commented 7 years ago

But this is "colon align"? It is absolutely horrible =/ and this doc doesn't seem to support it either?

funkyboy commented 7 years ago

Put your code in Xcode, select it and then Ctrl+I. That's the "canonical" alignment.