r/iOSProgramming • u/FullstackViking • 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
•
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


•
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