按照校对意见重新整理提交内容
1. 统一链接格式 2. 补充句号 3. 添加遗漏内容 & 修改其他格式问题
This commit is contained in:
@ -3,7 +3,8 @@
|
|||||||
### 2019-01-24
|
### 2019-01-24
|
||||||
|
|
||||||
* 更新到 Swift 5。
|
* 更新到 Swift 5。
|
||||||
* 添加了[动态调用](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID603)章节,其中包含有关使用 DynamicCallable 属性动态调用实例作为函数的信息。
|
* 增加了[拓展字符串分隔符](https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html#ID606)部分,另外在[字符串字面量](https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID417)部分更新了拓展字符串分隔符相关内容。
|
||||||
|
* 添加了[动态调用](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID603)章节,其中包含有关使用 `dynamicCallable` 属性动态调用实例作为函数的信息。
|
||||||
* 添加了[unknown](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID605)和[未来枚举匹配](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID602)章节,其中包含了使用 `unknown` 来处理未来枚举可能发生改变的情形。
|
* 添加了[unknown](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID605)和[未来枚举匹配](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID602)章节,其中包含了使用 `unknown` 来处理未来枚举可能发生改变的情形。
|
||||||
* 在[Key-Path]表达式章节添加了标示 key path (\.self) 相关内容。
|
* 在[Key-Path]表达式章节添加了标示 key path (\.self) 相关内容。
|
||||||
* 在[可选编译块](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID539)章节新增了小于比较符 `<` 相关内容。
|
* 在[可选编译块](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID539)章节新增了小于比较符 `<` 相关内容。
|
||||||
@ -20,7 +21,7 @@
|
|||||||
|
|
||||||
### 2018-03-29
|
### 2018-03-29
|
||||||
|
|
||||||
* 更新至 Swift 4.1
|
* 更新至 Swift 4.1。
|
||||||
* 在[等价运算符](https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#ID45)章节添加了等价运算符的合成实现信息。
|
* 在[等价运算符](https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#ID45)章节添加了等价运算符的合成实现信息。
|
||||||
* 在[声明](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html)一章的[申明拓展](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID378)部分和[协议](https://docs.swift.org/swift-book/LanguageGuide/Protocols.html)一章的[有条件地遵循协议](https://docs.swift.org/swift-book/LanguageGuide/Protocols.html#ID574)部分添加了协议的有条件遵循相关内容。
|
* 在[声明](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html)一章的[申明拓展](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID378)部分和[协议](https://docs.swift.org/swift-book/LanguageGuide/Protocols.html)一章的[有条件地遵循协议](https://docs.swift.org/swift-book/LanguageGuide/Protocols.html#ID574)部分添加了协议的有条件遵循相关内容。
|
||||||
* 在[关联类型约束中使用协议](https://docs.swift.org/swift-book/LanguageGuide/Generics.html#ID575)章节中添加了递归协议约束的内容。
|
* 在[关联类型约束中使用协议](https://docs.swift.org/swift-book/LanguageGuide/Generics.html#ID575)章节中添加了递归协议约束的内容。
|
||||||
@ -130,8 +131,8 @@
|
|||||||
|
|
||||||
### 2015-09-16
|
### 2015-09-16
|
||||||
|
|
||||||
* 更新至 Swift 2.0
|
* 更新至 Swift 2.0。
|
||||||
* 在[错误处理](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html)一章中增加了关于错误处理的相关内容,包括 [Do 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID533)、[Throw 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID518)、[Defer 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID532)以及 [try 运算符](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID516)
|
* 在[错误处理](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html)一章中增加了关于错误处理的相关内容,包括[Do 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID533)、[Throw 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID518)、[Defer 语句](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#ID532)以及[try 运算符](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID516)。
|
||||||
* 更新了[错误表示和抛出](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html#ID509)一节,现在所有类型都可以遵循 `ErrorType` 协议了。
|
* 更新了[错误表示和抛出](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html#ID509)一节,现在所有类型都可以遵循 `ErrorType` 协议了。
|
||||||
* 在[将错误装换成可选值](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html#ID542)一节增加了 `try` 关键字相关信息。
|
* 在[将错误装换成可选值](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html#ID542)一节增加了 `try` 关键字相关信息。
|
||||||
* 在[枚举](https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html)一章的[递归枚举](https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html#ID536)部分以及以及[声明](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html)一章的[任意类型用例的枚举](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID365)一节中新增了递归枚举相关信息。
|
* 在[枚举](https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html)一章的[递归枚举](https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html#ID536)部分以及以及[声明](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html)一章的[任意类型用例的枚举](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID365)一节中新增了递归枚举相关信息。
|
||||||
@ -192,7 +193,7 @@
|
|||||||
* 在构造器中,常量属性有且仅能被赋值一次。更多信息,请看[在构造过程中给常量属性赋值](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID212)。
|
* 在构造器中,常量属性有且仅能被赋值一次。更多信息,请看[在构造过程中给常量属性赋值](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID212)。
|
||||||
* 多个可选绑定现在可以在`if`语句后面以逗号分隔的赋值列表的方式出现,更多信息,请看[可选绑定](https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID333)。
|
* 多个可选绑定现在可以在`if`语句后面以逗号分隔的赋值列表的方式出现,更多信息,请看[可选绑定](https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID333)。
|
||||||
* 一个[可选链表达式](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID405)必须出现在后缀表达式中。
|
* 一个[可选链表达式](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID405)必须出现在后缀表达式中。
|
||||||
* 协议类型转换不再局限于 `@obj` 修饰的协议了
|
* 协议类型转换不再局限于 `@obj` 修饰的协议了。
|
||||||
* 在运行时可能会失败的类型转换可以使用 `as?` 和 `as!` 运算符,而确保不会失败的类型转换现在使用 `as` 运算符。更多信息,请看[类型转换运算符](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID388)。
|
* 在运行时可能会失败的类型转换可以使用 `as?` 和 `as!` 运算符,而确保不会失败的类型转换现在使用 `as` 运算符。更多信息,请看[类型转换运算符](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID388)。
|
||||||
|
|
||||||
### 2014-10-16
|
### 2014-10-16
|
||||||
@ -218,7 +219,7 @@
|
|||||||
* 现在,你可以通过下标赋值或者[可选调用链](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html)中的可变方法和操作符来给属性设值。相应地更新了有关[通过可选链接访问属性](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID248)的信息,并扩展了[通过可选链接调用方法](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID249)时检查方法调用成功的示例,以显示如何检查属性设置是否成功。
|
* 现在,你可以通过下标赋值或者[可选调用链](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html)中的可变方法和操作符来给属性设值。相应地更新了有关[通过可选链接访问属性](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID248)的信息,并扩展了[通过可选链接调用方法](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID249)时检查方法调用成功的示例,以显示如何检查属性设置是否成功。
|
||||||
* 在章节可选链中,增加一个新的小节[访问可选类型的下标脚注](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID251)。
|
* 在章节可选链中,增加一个新的小节[访问可选类型的下标脚注](https://docs.swift.org/swift-book/LanguageGuide/OptionalChaining.html#ID251)。
|
||||||
* 更新章节[访问和修改数组](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID110)以标示:从该版本起,不能再通过 `+=` 运算符给一个数组添加一个新的项。对应的替代方案是,使 `append` 方法,或者通过 `+=` 运算符来添加一个只有一个项的数组。
|
* 更新章节[访问和修改数组](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID110)以标示:从该版本起,不能再通过 `+=` 运算符给一个数组添加一个新的项。对应的替代方案是,使 `append` 方法,或者通过 `+=` 运算符来添加一个只有一个项的数组。
|
||||||
* 添加了一个提示:在[范围运算符](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID73)中,比如, `a...b` 和 `a..<b` ,起始值 `a` 不能大于结束值 `b` 。
|
* 添加了一个提示:在[范围运算符](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID73)中,比如, `a...b` 和 `a..<b` ,起始值 `a` 不能大于结束值 `b`。
|
||||||
* 重写了[继承](https://docs.swift.org/swift-book/LanguageGuide/Inheritance.html)这一章:删除了本章中关于构造器重写的介绍性报道;转而将更多的注意力放到新增的部分——子类的新功能,以及如何通过重写(overrides)修改已有的功能。另外,[重写属性的 Getters 和 Setters](https://docs.swift.org/swift-book/LanguageGuide/Inheritance.html#ID200)中的例子已经被替换为展示如何重写一个 `description` 属性。 (而关于如何在子类的构造器中修改继承属性的默认值的例子,已经被移到[构造过程](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html)这一章。)
|
* 重写了[继承](https://docs.swift.org/swift-book/LanguageGuide/Inheritance.html)这一章:删除了本章中关于构造器重写的介绍性报道;转而将更多的注意力放到新增的部分——子类的新功能,以及如何通过重写(overrides)修改已有的功能。另外,[重写属性的 Getters 和 Setters](https://docs.swift.org/swift-book/LanguageGuide/Inheritance.html#ID200)中的例子已经被替换为展示如何重写一个 `description` 属性。 (而关于如何在子类的构造器中修改继承属性的默认值的例子,已经被移到[构造过程](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html)这一章。)
|
||||||
* 更新了[构造器的继承与重写](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID221)小节以标示: 重写一个特定的构造器必须使用 `override` 修饰符。
|
* 更新了[构造器的继承与重写](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID221)小节以标示: 重写一个特定的构造器必须使用 `override` 修饰符。
|
||||||
* 更新[Required 构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID231)小节以标示:`required` 修饰符现在需要出现在所有子类的 required 构造器的声明中,而 required 构造器的实现,现在可以仅从父类自动继承。
|
* 更新[Required 构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID231)小节以标示:`required` 修饰符现在需要出现在所有子类的 required 构造器的声明中,而 required 构造器的实现,现在可以仅从父类自动继承。
|
||||||
@ -239,7 +240,7 @@
|
|||||||
* 加入新的章节[Required 构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID231)。
|
* 加入新的章节[Required 构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID231)。
|
||||||
* 加入新的章节[可选元组返回类型](https://docs.swift.org/swift-book/LanguageGuide/Functions.html#ID165)。
|
* 加入新的章节[可选元组返回类型](https://docs.swift.org/swift-book/LanguageGuide/Functions.html#ID165)。
|
||||||
* 更新了[类型标注](https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID312)章节:多个相关变量可以用"类型标注”在同一行中声明为同一类型。
|
* 更新了[类型标注](https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID312)章节:多个相关变量可以用"类型标注”在同一行中声明为同一类型。
|
||||||
* `@optional`, `@lazy`, `@final`, `@required` 等关键字被更新为 `optional`, `lazy`, `final`, `required` 参见[声明修饰符](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID381).
|
* `@optional`, `@lazy`, `@final`, `@required` 等关键字被更新为 `optional`, `lazy`, `final`, `required` 参见[声明修饰符](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID381)。
|
||||||
* 更新整本书中关于 `..<` 的引用,从半闭区间改为了[半开区间](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID75)。
|
* 更新整本书中关于 `..<` 的引用,从半闭区间改为了[半开区间](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID75)。
|
||||||
* 更新了小节[读取和修改字典](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID116): `Dictionary` 现在增加了一个 Boolean 型的属性:`isEmpty`。
|
* 更新了小节[读取和修改字典](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID116): `Dictionary` 现在增加了一个 Boolean 型的属性:`isEmpty`。
|
||||||
* 解释了哪些字符(集)可被用来定义[自定义操作符](https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#ID46)。
|
* 解释了哪些字符(集)可被用来定义[自定义操作符](https://docs.swift.org/swift-book/LanguageGuide/AdvancedOperators.html#ID46)。
|
||||||
@ -250,5 +251,5 @@
|
|||||||
* 加入新的小节:[字典键类型的哈希值](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID493)。
|
* 加入新的小节:[字典键类型的哈希值](https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html#ID493)。
|
||||||
* [闭包表达式](https://docs.swift.org/swift-book/LanguageGuide/Closures.html#ID95)示例中使用新的全局函数 `sorted` 取代原先的全局函数 `sort` 去展示如何返回一个全新的数组。
|
* [闭包表达式](https://docs.swift.org/swift-book/LanguageGuide/Closures.html#ID95)示例中使用新的全局函数 `sorted` 取代原先的全局函数 `sort` 去展示如何返回一个全新的数组。
|
||||||
* 更新关于[结构体逐一成员构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID214)的描述:即使结构体的成员 `没有默认值`,逐一成员构造器也可以自动获得。
|
* 更新关于[结构体逐一成员构造器](https://docs.swift.org/swift-book/LanguageGuide/Initialization.html#ID214)的描述:即使结构体的成员 `没有默认值`,逐一成员构造器也可以自动获得。
|
||||||
* [半开区间运算符](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID75)由`..` 改为 `..<`
|
* [半开区间运算符](https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html#ID75)由`..` 改为 `..<`。
|
||||||
* 添加一个[泛型拓展](https://docs.swift.org/swift-book/LanguageGuide/Generics.html#ID185)的示例。
|
* 添加一个[泛型拓展](https://docs.swift.org/swift-book/LanguageGuide/Generics.html#ID185)的示例。
|
||||||
|
|||||||
Reference in New Issue
Block a user