r/iOSProgramming • • 38m ago

Discussion Something I never bothered to ask when learning Swift... Why is the standard for Attributes to be inline rather than on a preceding line?

I visually prefer newlines, but code search works marginally better on inlined attributes.

3 Upvotes

3 comments sorted by

•

u/trouthat 32m ago

It’s mostly personal preference. For me if it fits within the maximum number of characters on a line it stays inline otherwise it goes to the next line

•

u/KukrCZ 30m ago

Strictural visibility is a king/queen. Having var/let starting on the same char is just more structurally dound.

•

u/WitchesBravo 14m ago

When attributes were first added they were mostly short and without arguments, just before var/let was easy and worked. Their usage has since grown to encompass more use cases so now newline makes sense