diff --git a/source/chapter1/03_revision_history.md b/source/chapter1/03_revision_history.md index 27151a84..35d513bf 100644 --- a/source/chapter1/03_revision_history.md +++ b/source/chapter1/03_revision_history.md @@ -31,58 +31,58 @@
- Optionals no longer implicitly evaluate to true when they have a value and false when they do not, to avoid confusion when working with optional Bool values. Instead, make an explicit check against nil with the == or != operators to find out if an optional contains a value.
+ Optionals no longer implicitly evaluate to true when they have a value and false when they do not, to avoid confusion when working with optional Bool values. Instead, make an explicit check against nil with the == or != operators to find out if an optional contains a value.
- Swift now has a Nil Coalescing Operator (a ?? b), which unwraps an optional’s value if it exists, or returns a default value if the optional is nil.
+ Swift now has a Nil Coalescing Operator (a ?? b), which unwraps an optional’s value if it exists, or returns a default value if the optional is nil.
- Updated and expanded the Comparing Strings section to reflect and demonstrate that string and character comparison and prefix / suffix comparison are now based on Unicode canonical equivalence of extended grapheme clusters.
++ Updated and expanded the Comparing Strings section to reflect and demonstrate that string and character comparison and prefix / suffix comparison are now based on Unicode canonical equivalence of extended grapheme clusters.
- You can now try to set a property’s value, assign to a subscript, or call a mutating method or operator through Optional Chaining. The information about Accessing Properties Through Optional Chaining has been updated accordingly, and the examples of checking for method call success in Calling Methods Through Optional Chaining have been expanded to show how to check for property setting success.
++ You can now try to set a property’s value, assign to a subscript, or call a mutating method or operator through Optional Chaining. The information about Accessing Properties Through Optional Chaining has been updated accordingly, and the examples of checking for method call success in Calling Methods Through Optional Chaining have been expanded to show how to check for property setting success.
- Added a new section about Accessing Subscripts of Optional Type through optional chaining.
++ Added a new section about Accessing Subscripts of Optional Type through optional chaining.
- Updated the Accessing and Modifying an Array section to note that you can no longer append a single item to an array with the += operator. Instead, use the append method, or append a single-item array with the += operator.
- Added a note that the start value a for the Range Operators a...b and a..<b must not be greater than the end value b.
+ Updated the Accessing and Modifying an Array section to note that you can no longer append a single item to an array with the += operator. Instead, use the append method, or append a single-item array with the += operator.
+ Added a note that the start value a for the Range Operators a...b and a..<b must not be greater than the end value b.
- Rewrote the Inheritance chapter to remove its introductory coverage of initializer overrides. This chapter now focuses more on the addition of new functionality in a subclass, and the modification of existing functionality with overrides. The chapter’s example of Overriding Property Getters and Setters has been rewritten to show how to override a description property. (The examples of modifying an inherited property’s default value in a subclass initializer have been moved to the Initialization chapter.)
+ Rewrote the Inheritance chapter to remove its introductory coverage of initializer overrides. This chapter now focuses more on the addition of new functionality in a subclass, and the modification of existing functionality with overrides. The chapter’s example of Overriding Property Getters and Setters has been rewritten to show how to override a description property. (The examples of modifying an inherited property’s default value in a subclass initializer have been moved to the Initialization chapter.)
- Updated the Initializer Inheritance and Overriding section to note that overrides of a designated initializer must now be marked with the override modifier.
+ Updated the Initializer Inheritance and Overriding section to note that overrides of a designated initializer must now be marked with the override modifier.
- Updated the Required Initializers section to note that the required modifier is now written before every subclass implementation of a required initializer, and that the requirements for required initializers can now be satisfied by automatically inherited initializers.
+ Updated the Required Initializers section to note that the required modifier is now written before every subclass implementation of a required initializer, and that the requirements for required initializers can now be satisfied by automatically inherited initializers.
- Infix Operator Functions no longer require the @infix attribute.
+ Infix Operator Functions no longer require the @infix attribute.
- The @prefix and @postfix attributes for Prefix and Postfix Operators have been replaced by prefix and postfix declaration modifiers.
+ The @prefix and @postfix attributes for Prefix and Postfix Operators have been replaced by prefix and postfix declaration modifiers.
- Added a note about the order in which Prefix and Postfix Operators are applied when both a prefix and a postfix operator are applied to the same operand.
++ Added a note about the order in which Prefix and Postfix Operators are applied when both a prefix and a postfix operator are applied to the same operand.
- Operator functions for Compound Assignment Operators no longer use the @assignment attribute when defining the function.
+ Operator functions for Compound Assignment Operators no longer use the @assignment attribute when defining the function.
- The order in which modifiers are specified when defining Custom Operators has changed. You now write prefix operator rather than operator prefix, for example.
+ 在这个版本中,在定义自定义操作符(Custom Operators) 时,修改器(Modifiers)的出现顺序发生变化。比如, 现在,你该编写 prefix operator, 而不是 operator prefix.
- Added information about the dynamic declaration modifier in Declaration Modifiers.
+ 增加信息:关于dynamic 声明修改器(declaration modifier),于章节 声明修改器(Declaration Modifiers).
- Added information about how type inference works with Literals.
+
+ 增加信息:关于类型推导(type inference)如何作用于字面量
- Added more information about Curried Functions.
+ 为章节Curried Functions添加了更多的信息.
- Added a new chapter about Access Control.
++ 加入新的章节 权限控制(Access Control).
- Updated the Strings and Characters chapter to reflect the fact that Swift’s Character type now represents a single Unicode extended grapheme cluster. Includes a new section on Extended Grapheme Clusters and more information about Unicode Scalars and Comparing Strings.
+ 更新了章节 字符串和字符(Strings and Characters) 用以表明,在Swift中,Character 类型现在代表的是扩展字符集(extended grapheme cluster)中的一个Unicode,为此,新增了小节 Extended Grapheme Clusters 。同时,为小节 Unicode标量(Unicode Scalars) 和 字符串比较(Comparing Strings)增加了更多内容.
- Updated the String Literals section to note that Unicode scalars inside string literals are now written as \u{n}, where n is between one and eight hexadecimal digits.
+ 更新章节字符串字面量(String Literals):在一个字符串中,Unicode标量(Unicode scalars) 以 \u{n}的形式来表示, n 是一个最大可以有8位的16进制数(hexadecimal digits)
- The NSString length property is now mapped onto Swift’s native String type as utf16Count, not utf16count.
+ NSString length 属性已被映射到Swift的内建 String类型。(注意,这两属性的类型是utf16,而非 utf16count).
- Swift’s native String type no longer has an uppercaseString or lowercaseString property. The corresponding section in Strings and Characters has been removed, and various code examples have been updated.
+ Swift的内建 String 类型不再拥有 uppercaseString 和 lowercaseString 属性.其对应部分在章节 字符串和字符(Strings and Characters)已经被删除, 并且各种对应的代码用例也已被更新.
- Added a new section about Initializer Parameters Without External Names.
++ 加入新的章节 没有外部名的构造器参数(Initializer Parameters Without External Names).
- Added a new section about Required Initializers.
++ 加入新的章节 Required构造器(Required Initializers).
- Added a new section about Optional Tuple Return Types.
+- Updated the Type Annotations section to note that multiple related variables can be defined on a single line with one type annotation.
++ 更新章节 类型标注(Type Annotations) :多个相关变量可以用“类型标注”(type annotaion)在同一行中声明为同一类型。
- The @optional, @lazy, @final, and @required attributes are now the optional, lazy, final, and required Declaration Modifiers.
+ @optional, @lazy, @final, @required 等关键字被更新为 optional, lazy, final, required 参见声明修改器(Declaration Modifiers).
- Updated the entire book to refer to ..< as the Half-Open Range Operator (rather than the “half-closed range operator”).
+ 更新整本书 —— 引用 ..< 作为区间运算符(Half-Open Range Operator) (取代原先的.. ).
- Updated the Accessing and Modifying a Dictionary section to note that Dictionary now has a Boolean isEmpty property.
+ 更新了小节 读取和修改字典(Accessing and Modifying a Dictionary): Dictionary 现在早呢更加了一个 Boolean型的属性: isEmpty
- Clarified the full list of characters that can be used when defining Custom Operators.
++ 解释了哪些字符(集)可被用来定义自定义操作符 (Custom Operators)
- nil and the Booleans true and false are now Literals.
+ nil 和布尔运算中的 true 和 false 现在被定义为字面量Literals.
- Swift’s Array type now has full value semantics. Updated the information about Mutability of Collections and Arrays to reflect the new approach. Also clarified the Assignment and Copy Behavior for Strings, Arrays, and Dictionaries.
+ Swift 中的数组 (Array) 类型从现在起具备了完整的值语义。具体信息被更新到 集合的可变性(Mutability of Collections) 和 数组(Arrays) 两小节,以反映这个新的变化. 此外,还解释了如何 给Strings, Arrays和Dictionaries进行赋值和拷贝 (Assignment and Copy Behavior for Strings, Arrays, and Dictionaries).
- 数组类型速记语法(Array Type Shorthand Syntax) 从 SomeType[].更新为[SomeType]
+ 数组类型速记语法(Array Type Shorthand Syntax) 从 SomeType[].更新为[SomeType]
- 加入新的小节:字典类型的速记语法(Dictionary Type Shorthand Syntax).: [KeyType: ValueType].
+ 加入新的小节:字典类型的速记语法(Dictionary Type Shorthand Syntax).: [KeyType: ValueType].
- 例子 闭包表达式 (Closure Expressions) 中使用新的全局函数 sorted 取代原先的全局函数 sort 去展示如何返回一个全新的数组.
+ 例子 闭包表达式 (Closure Expressions) 中使用新的全局函数 sorted 取代原先的全局函数 sort 去展示如何返回一个全新的数组.
- 更新关于 结构体逐一成员构造器 (Memberwise Initializers for Structure Types) 的描述:即使结构体的成员没有默认值,逐一成员构造器也可以自动获得。
++ 更新关于 结构体逐一成员构造器 (Memberwise Initializers for Structure Types) 的描述:即使结构体的成员没有默认值,逐一成员构造器也可以自动获得。
- 区间运算符(Half-Open Range Operator)由..更新到..<
-
+
+ 区间运算符(Half-Open Range Operator)由..更新到..<
+
+
发布新的文档用以详述Swift - 苹果公司针对iOS和OS X应用的全新开发语言
+
苹果全球开发者大会WWDC2014召开,发布了苹果最新的开发语言Swift,并释放出XCode6 Beta1版本