nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.63k stars 623 forks source link

Applying trailing closures in Modifiers. #1686

Closed kwokpia closed 1 month ago

kwokpia commented 2 months ago

Help, how can this be achieved?


-         List(...){...}.toolbar(content: { ... })
+         List(...){...}.toolbar {...}
nicklockwood commented 1 month ago

@kwokpia if you add the argument --trailingclosures toolbar it will convert this case. Normally only anonymous closure arguments are converted to trailing.

kwokpia commented 1 month ago

@kwokpia if you add the argument --trailingclosures toolbar it will convert this case. Normally only anonymous closure arguments are converted to trailing.

It worked as expected. Thanks!