Merge pull request #28 from robb/patch-1
Put the colon after the key type for dictionaries
This commit is contained in:
Коммит
c11184ff66
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче