Merge pull request #28 from robb/patch-1

Put the colon after the key type for dictionaries
This commit is contained in:
Rob Rix 2015-01-05 10:22:15 -05:00
Родитель 65797b5a55 6790fab2ca
Коммит c11184ff66
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -134,6 +134,13 @@ func makeCoffee(type: CoffeeType) -> Coffee { ... }
_Rationale:_ The type specifier is saying something about the _identifier_ so
it should be positioned with it.
Also, when specifying the type of a dictionary, always put the colon immediately
after the key type, followed by a space and then the value type.
```swift
let capitals: [Country: City] = [ Sweden: Stockholm ]
```
#### Only explicitly refer to `self` when required
When accessing properties or methods on `self`, leave the reference to `self` implicit by default: