hit counter

Timeline

My development logbook

Semi-colon in Swift

The perfered style of semi-colon placement in swift is:

1
2
3
4
5
6
7
struct Foo: SomeProtocol {}
class Foo: SomeProtocol {}

var x: Int
func foo(x: Int) {}
func bar(x: (y: Int) -> Int) -> Double {}
let dict = ["key": value]

i.e. No space before the semi-colon. One space after the semi-colon