Merge branch 'gh-pages' into sunsetwan-translation

This commit is contained in:
Sunset Wan
2019-07-01 00:09:07 +08:00
committed by GitHub
4 changed files with 198 additions and 190 deletions

View File

@ -240,7 +240,9 @@ struct Size {
let twoByTwo = Size(width: 2.0, height: 2.0)
```
当你调用一个逐一成员构造器memberwise initializer可以省略任何一个有默认值的属性。在上面这个例子中`Size` 结构体的 `height``width` 属性各有一个默认值。你可以省略两者或两者之一,对于被省略的属性,构造器会使用默认值。举个例子:
```
let zeroByTwo = Size(height: 2.0)
print(zeroByTwo.width, zeroByTwo.height)