[swift-users] Source code " : " guidelines

Stephen Celis stephen.celis at gmail.com
Sat Dec 5 12:48:53 CST 2015


I believe Apple style prefers no space to the left:

https://twitter.com/_jackhl/status/646723367576276992 <https://twitter.com/_jackhl/status/646723367576276992>

Stephen

> On Dec 5, 2015, at 1:43 PM, 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)
> 
> -- 
> Paul
> 
> On December 5, 2015 at 10:24:40, Kostiantyn Koval (konstantin.koval1 at gmail.com <mailto:konstantin.koval1 at gmail.com>) wrote:
> 
>> Hi Swift team, 
>> 
>> Is there a perfect style for ":" when declaring a Type?
>> I have seen 2 styles in Swift source code.
>> 
>> extension Deck : Equatable
>> extension Deck: Equatable 
>> 
>> Is there any guideline for it or both are acceptable?
>> 
>> Best Regards,
>> Kostiantyn
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
>  _______________________________________________
> swift-users mailing list
> swift-users at swift.org <mailto:swift-users at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-users <https://lists.swift.org/mailman/listinfo/swift-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151205/3b7cfdca/attachment-0001.html>


More information about the swift-users mailing list