[swift-users] Source code " : " guidelines

Dave Abrahams dabrahams at apple.com
Fri Mar 25 10:28:45 CDT 2016


on Sat Dec 05 2015, Paul Schifferer <paul-AT-schifferers.net> wrote:

> My personal preference is to put a space on both sides of the colon when it’s used for declaration or extension:
>
> class SomeClass : SomeProtocol {
>   var name : String
> }
>
> and a space only after it’s used for providing a value (as in a function parameter):
>
> object.callSomething(value: v)

That's the style we use in the Swift standard library, FWIW.
-- 
Dave



More information about the swift-users mailing list