Allen
Allen

Reputation: 3771

How to format long Objective-C methods?

Is there a short way in Xcode to format the following:

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:<#(NSString *)#> message:<#(NSString *)#> delegate:<#(id)#> cancelButtonTitle:<#(NSString *)#> otherButtonTitles:<#(NSString *), ...#>, nil];

to

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:<#(NSString *)#>
                                                    message:<#(NSString *)#>
                                                   delegate:<#(id)#>
                                          cancelButtonTitle:<#(NSString *)#>
                                          otherButtonTitles:<#(NSString *), ...#>, nil];

Upvotes: 0

Views: 135

Answers (2)

Daij-Djan
Daij-Djan

Reputation: 50089

Use uncrustify code formatter: http://uncrustify.sourceforge.net (It is VERY flexible. Virtually anything can be configured)

xcode plugin: https://github.com/benoitsan/BBUncrustifyPlugin-Xcode

Upvotes: 1

johnMa
johnMa

Reputation: 3311

Here is an excellent XCode Plugin ClangFormat by @travisjeffery. it will save you some time to press enter.

Upvotes: 1

Related Questions