[swift-users] Source code " : " guidelines

Paul Schifferer paul at schifferers.net
Sat Dec 5 12:43:41 CST 2015


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) 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151205/b9af678a/attachment.html>


More information about the swift-users mailing list