From 86a6802d5daa9b12d40d747d2828c9e8afb9e6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=9D=B0?= Date: Mon, 25 Aug 2014 21:14:56 +0800 Subject: [PATCH] add code highlight --- source/chapter1/02_a_swift_tour.md | 5 ++ source/chapter1/03_revision_history.md | 4 + source/chapter2/01_The_Basics.md | 4 + source/chapter2/02_Basic_Operators.md | 78 ++++++++++--------- source/chapter2/03_Strings_and_Characters.md | 4 + source/chapter2/04_Collection_Types.md | 10 ++- source/chapter2/05_Control_Flow.md | 4 + source/chapter2/06_Functions.md | 4 + source/chapter2/07_Closures.md | 4 + source/chapter2/08_Enumerations.md | 4 + source/chapter2/09_Classes_and_Structures.md | 4 + source/chapter2/10_Properties.md | 4 + source/chapter2/11_Methods.md | 4 + source/chapter2/12_Subscripts.md | 4 + source/chapter2/13_Inheritance.md | 4 + source/chapter2/14_Initialization.md | 4 + source/chapter2/15_Deinitialization.md | 4 + .../16_Automatic_Reference_Counting.md | 4 + source/chapter2/17_Optional_Chaining.md | 4 + source/chapter2/18_Type_Casting.md | 4 + source/chapter2/19_Nested_Types.md | 4 + source/chapter2/20_Extensions.md | 4 + source/chapter2/21_Protocols.md | 4 + source/chapter2/22_Generics.md | 4 + source/chapter2/23_Access_Control.md | 4 + source/chapter2/24_Advanced_Operators.md | 4 + .../01_About_the_Language_Reference.md | 4 + source/chapter3/02_Lexical_Structure.md | 4 + source/chapter3/03_Types.md | 4 + source/chapter3/04_Expressions.md | 4 + source/chapter3/05_Declarations.md | 4 + source/chapter3/06_Attributes.md | 4 + source/chapter3/07_Patterns.md | 4 + .../08_Generic_Parameters_and_Arguments.md | 4 + source/chapter3/09_Summary_of_the_Grammar.md | 4 + source/chapter3/10_Statements.md | 4 + source/chapter4/01_Access_Control.md | 4 + source/chapter4/02_Type_Custom.md | 4 + source/chapter4/03_Ballons.md | 4 + .../04_Interacting_with_C_Pointers.md | 4 + .../chapter4/05_Value_and_Reference_Types.md | 4 + .../chapter4/06_access_control_&_protected.md | 4 + 42 files changed, 209 insertions(+), 40 deletions(-) diff --git a/source/chapter1/02_a_swift_tour.md b/source/chapter1/02_a_swift_tour.md index 622c3a5b..f8af4da7 100755 --- a/source/chapter1/02_a_swift_tour.md +++ b/source/chapter1/02_a_swift_tour.md @@ -1,6 +1,11 @@ > 翻译:[numbbbbb](https://github.com/numbbbbb) > 校对:[shinyzhu](https://github.com/shinyzhu), [stanzhai](https://github.com/stanzhai) + + + + + # Swift 初见 --- diff --git a/source/chapter1/03_revision_history.md b/source/chapter1/03_revision_history.md index 52013eac..edcf4855 100644 --- a/source/chapter1/03_revision_history.md +++ b/source/chapter1/03_revision_history.md @@ -1,6 +1,10 @@ > 翻译:[成都老码团队翻译组-Ayra](http://weibo.com/littlekok/) > 校对:[成都老码团队翻译组-Oberyn](http://weibo.com/u/5241713117) + + + + # Swift 版本历史记录 --- diff --git a/source/chapter2/01_The_Basics.md b/source/chapter2/01_The_Basics.md index 6d71bbaa..50eb73d0 100755 --- a/source/chapter2/01_The_Basics.md +++ b/source/chapter2/01_The_Basics.md @@ -1,6 +1,10 @@ > 翻译:[numbbbbb](https://github.com/numbbbbb), [lyuka](https://github.com/lyuka), [JaySurplus](https://github.com/JaySurplus) > 校对:[lslxdx](https://github.com/lslxdx) + + + + # 基础部分 ----------------- diff --git a/source/chapter2/02_Basic_Operators.md b/source/chapter2/02_Basic_Operators.md index fc605b38..df71a0e2 100755 --- a/source/chapter2/02_Basic_Operators.md +++ b/source/chapter2/02_Basic_Operators.md @@ -3,6 +3,10 @@ > 校对:[EvilCome](https://github.com/Evilcome) > 最终校对:[老码团队翻译组-Tyrion](http://weibo.com/u/5241713117) + + + + # 基本运算符 ----------------- @@ -13,7 +17,7 @@ - [算术运算符](#arithmetic_operators) - [组合赋值运算符(Compound Assignment Operators)](#compound_assignment_operators) - [比较运算符](#comparison_operators) -- [三目运算符(Ternary Conditional Operator)](#ternary_conditional_operator) +- [三目运算符(Ternary Conditional Operator)](#ternary_conditional_operator) - [空合运算符](#nil_coalescing_operator) - [区间运算符](#range_operators) - [逻辑运算符](#logical_operators) @@ -286,46 +290,46 @@ Swift 也提供恒等`===`和不恒等`!==`这两个比较符来判断两个对 rowHeight = rowHeight + 20 } // rowHeight 现在是 90 - + 第一段代码例子使用了三目运算,所以一行代码就能让我们得到正确答案。这比第二段代码简洁得多,无需将`rowHeight`定义成变量,因为它的值无需在`if`语句中改变。 三目运算提供有效率且便捷的方式来表达二选一的选择。需要注意的事,过度使用三目运算符会使简洁的代码变的难懂。我们应避免在一个组合语句中使用多个三目运算符。 - - -## 空合运算符(Nil Coalescing Operator) - -空合运算符(`a ?? b`)将对可选类型`a`进行空判断,如果`a`包含一个值就进行解封,否则就返回一个默认值`b`.这个运算符有两个条件: - -- 表达式`a`必须是Optional类型 -- 默认值`b`的类型必须要和`a`存储值的类型保持一致 - -空合并运算符是对以下代码的简短表达方法 - - a != nil ? a! : b - -上述代码使用了三目运算符。当可选类型`a`的值不为空时,进行强制解封(`a!`)访问`a`中值,反之当`a`中值为空时,返回默认值b。无疑空合运算符(`??`)提供了一种更为优雅的方式去封装条件判断和解封两种行为,显得简洁以及更具可读性。 - -> 注意: -如果`a`为非空值(`non-nil`),那么值`b`将不会被估值。这也就是所谓的短路求值。 - -下文例子采用空合并运算符,实现了在默认颜色名和可选自定义颜色名之间抉择: - - - let defaultColorName = "red" - var userDefinedColorName:String? //默认值为nil - var colorNameToUse = userDefinedColorName ?? defaultColorName - //userDefinedColorName的值为空 ,所以colorNameToUse的值为`red` - - -`userDefinedColorName`变量被定义为一个可选字符串类型,默认值为nil。由于`userDefinedColorName`是一个可选类型,我们可以使用空合运算符去判断其值。在上一个例子中,通过空合运算符为一个名为`colorNameToUse`的变量赋予一个字符串类型初始值。 -由于`userDefinedColorName`值为空,因此表达式` userDefinedColorName ?? defaultColorName `返回默认值,即`red`。 - -另一种情况,分配一个非空值(`non-nil`)给 `userDefinedColorName`,再次执行空合运算,运算结果为封包在`userDefaultColorName`中的值,而非默认值。 - - userDefinedColor = "green" - colorNameToUse = userDefinedColorName ?? defaultColorName - //userDefinedColor非空,因此colorNameToUsede的值为绿色 + + +## 空合运算符(Nil Coalescing Operator) + +空合运算符(`a ?? b`)将对可选类型`a`进行空判断,如果`a`包含一个值就进行解封,否则就返回一个默认值`b`.这个运算符有两个条件: + +- 表达式`a`必须是Optional类型 +- 默认值`b`的类型必须要和`a`存储值的类型保持一致 + +空合并运算符是对以下代码的简短表达方法 + + a != nil ? a! : b + +上述代码使用了三目运算符。当可选类型`a`的值不为空时,进行强制解封(`a!`)访问`a`中值,反之当`a`中值为空时,返回默认值b。无疑空合运算符(`??`)提供了一种更为优雅的方式去封装条件判断和解封两种行为,显得简洁以及更具可读性。 + +> 注意: +如果`a`为非空值(`non-nil`),那么值`b`将不会被估值。这也就是所谓的短路求值。 + +下文例子采用空合并运算符,实现了在默认颜色名和可选自定义颜色名之间抉择: + + + let defaultColorName = "red" + var userDefinedColorName:String? //默认值为nil + var colorNameToUse = userDefinedColorName ?? defaultColorName + //userDefinedColorName的值为空 ,所以colorNameToUse的值为`red` + + +`userDefinedColorName`变量被定义为一个可选字符串类型,默认值为nil。由于`userDefinedColorName`是一个可选类型,我们可以使用空合运算符去判断其值。在上一个例子中,通过空合运算符为一个名为`colorNameToUse`的变量赋予一个字符串类型初始值。 +由于`userDefinedColorName`值为空,因此表达式` userDefinedColorName ?? defaultColorName `返回默认值,即`red`。 + +另一种情况,分配一个非空值(`non-nil`)给 `userDefinedColorName`,再次执行空合运算,运算结果为封包在`userDefaultColorName`中的值,而非默认值。 + + userDefinedColor = "green" + colorNameToUse = userDefinedColorName ?? defaultColorName + //userDefinedColor非空,因此colorNameToUsede的值为绿色 ## 区间运算符 diff --git a/source/chapter2/03_Strings_and_Characters.md b/source/chapter2/03_Strings_and_Characters.md index 0cca5497..2ee85398 100755 --- a/source/chapter2/03_Strings_and_Characters.md +++ b/source/chapter2/03_Strings_and_Characters.md @@ -1,6 +1,10 @@ > 翻译:[wh1100717](https://github.com/wh1100717) > 校对:[Hawstein](https://github.com/Hawstein) + + + + # 字符串和字符(Strings and Characters) ----------------- diff --git a/source/chapter2/04_Collection_Types.md b/source/chapter2/04_Collection_Types.md index 7710c088..72086361 100755 --- a/source/chapter2/04_Collection_Types.md +++ b/source/chapter2/04_Collection_Types.md @@ -1,6 +1,10 @@ > 翻译:[zqp](https://github.com/zqp) > 校对:[shinyzhu](https://github.com/shinyzhu), [stanzhai](https://github.com/stanzhai) + + + + # 集合类型 (Collection Types) ----------------- @@ -89,9 +93,9 @@ shoppingList.append("Flour") 除此之外,使用加法赋值运算符(`+=`)也可以直接在数组后面添加一个或多个拥有相同类型的数据项: ```swift -shoppingList += ["Baking Powder"] -// shoppingList 现在有四项了 -shoppingList += ["Chocolate Spread","Cheese","Butter"] +shoppingList += ["Baking Powder"] +// shoppingList 现在有四项了 +shoppingList += ["Chocolate Spread","Cheese","Butter"] // shoppingList 现在有七项了 ``` diff --git a/source/chapter2/05_Control_Flow.md b/source/chapter2/05_Control_Flow.md index 8ee3f8de..04dbaae9 100755 --- a/source/chapter2/05_Control_Flow.md +++ b/source/chapter2/05_Control_Flow.md @@ -1,6 +1,10 @@ > 翻译:[vclwei](https://github.com/vclwei), [coverxit](https://github.com/coverxit), [NicePiao](https://github.com/NicePiao) > 校对:[coverxit](https://github.com/coverxit), [stanzhai](https://github.com/stanzhai) + + + + # 控制流 ----------------- diff --git a/source/chapter2/06_Functions.md b/source/chapter2/06_Functions.md index af4c47b0..3c0bd35b 100755 --- a/source/chapter2/06_Functions.md +++ b/source/chapter2/06_Functions.md @@ -1,6 +1,10 @@ > 翻译:[honghaoz](https://github.com/honghaoz) > 校对:[LunaticM](https://github.com/LunaticM) + + + + # 函数(Functions) ----------------- diff --git a/source/chapter2/07_Closures.md b/source/chapter2/07_Closures.md index 9699ed45..42adba9d 100755 --- a/source/chapter2/07_Closures.md +++ b/source/chapter2/07_Closures.md @@ -1,6 +1,10 @@ > 翻译:[wh1100717](https://github.com/wh1100717) > 校对:[lyuka](https://github.com/lyuka) + + + + # 闭包(Closures) ----------------- diff --git a/source/chapter2/08_Enumerations.md b/source/chapter2/08_Enumerations.md index 89d81b18..c2d4a778 100755 --- a/source/chapter2/08_Enumerations.md +++ b/source/chapter2/08_Enumerations.md @@ -1,6 +1,10 @@ > 翻译:[yankuangshi](https://github.com/yankuangshi) > 校对:[shinyzhu](https://github.com/shinyzhu) + + + + # 枚举(Enumerations) --- diff --git a/source/chapter2/09_Classes_and_Structures.md b/source/chapter2/09_Classes_and_Structures.md index 6f3c108f..06c7dbe0 100755 --- a/source/chapter2/09_Classes_and_Structures.md +++ b/source/chapter2/09_Classes_and_Structures.md @@ -1,6 +1,10 @@ > 翻译:[JaySurplus](https://github.com/JaySurplus) > 校对:[sg552](https://github.com/sg552) + + + + # 类和结构体 本页包含内容: diff --git a/source/chapter2/10_Properties.md b/source/chapter2/10_Properties.md index 26fd4937..75f0b21e 100755 --- a/source/chapter2/10_Properties.md +++ b/source/chapter2/10_Properties.md @@ -1,6 +1,10 @@ > 翻译:[shinyzhu](https://github.com/shinyzhu) > 校对:[pp-prog](https://github.com/pp-prog) + + + + # 属性 (Properties) --- diff --git a/source/chapter2/11_Methods.md b/source/chapter2/11_Methods.md index 108bca27..b63aeb0a 100755 --- a/source/chapter2/11_Methods.md +++ b/source/chapter2/11_Methods.md @@ -1,6 +1,10 @@ > 翻译:[pp-prog](https://github.com/pp-prog) > 校对:[zqp](https://github.com/zqp) + + + + # 方法(Methods) ----------------- diff --git a/source/chapter2/12_Subscripts.md b/source/chapter2/12_Subscripts.md index 2bca9399..12520cae 100755 --- a/source/chapter2/12_Subscripts.md +++ b/source/chapter2/12_Subscripts.md @@ -1,6 +1,10 @@ > 翻译:[siemenliu](https://github.com/siemenliu) > 校对:[zq54zquan](https://github.com/zq54zquan) + + + + # 下标脚本(Subscripts) ----------------- diff --git a/source/chapter2/13_Inheritance.md b/source/chapter2/13_Inheritance.md index 460918b8..bda08a4b 100755 --- a/source/chapter2/13_Inheritance.md +++ b/source/chapter2/13_Inheritance.md @@ -1,6 +1,10 @@ > 翻译:[Hawstein](https://github.com/Hawstein) > 校对:[menlongsheng](https://github.com/menlongsheng) + + + + # 继承(Inheritance) ------------------- diff --git a/source/chapter2/14_Initialization.md b/source/chapter2/14_Initialization.md index 98638fc6..e7b397aa 100755 --- a/source/chapter2/14_Initialization.md +++ b/source/chapter2/14_Initialization.md @@ -1,6 +1,10 @@ > 翻译:[lifedim](https://github.com/lifedim) > 校对:[lifedim](https://github.com/lifedim) + + + + # 构造过程(Initialization) ----------------- diff --git a/source/chapter2/15_Deinitialization.md b/source/chapter2/15_Deinitialization.md index 57a17a88..838b3952 100755 --- a/source/chapter2/15_Deinitialization.md +++ b/source/chapter2/15_Deinitialization.md @@ -1,6 +1,10 @@ > 翻译:[bruce0505](https://github.com/bruce0505) > 校对:[fd5788](https://github.com/fd5788) + + + + # 析构过程(Deinitialization) --------------------------- diff --git a/source/chapter2/16_Automatic_Reference_Counting.md b/source/chapter2/16_Automatic_Reference_Counting.md index 5bb00b28..30b59787 100755 --- a/source/chapter2/16_Automatic_Reference_Counting.md +++ b/source/chapter2/16_Automatic_Reference_Counting.md @@ -1,6 +1,10 @@ > 翻译:[TimothyYe](https://github.com/TimothyYe) > 校对:[Hawstein](https://github.com/Hawstein) + + + + # 自动引用计数 ----------------- diff --git a/source/chapter2/17_Optional_Chaining.md b/source/chapter2/17_Optional_Chaining.md index 185ed927..7a31ff2e 100755 --- a/source/chapter2/17_Optional_Chaining.md +++ b/source/chapter2/17_Optional_Chaining.md @@ -1,6 +1,10 @@ > 翻译:[Jasonbroker](https://github.com/Jasonbroker) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # Optional Chaining ----------------- diff --git a/source/chapter2/18_Type_Casting.md b/source/chapter2/18_Type_Casting.md index 14e69676..64f62724 100755 --- a/source/chapter2/18_Type_Casting.md +++ b/source/chapter2/18_Type_Casting.md @@ -1,6 +1,10 @@ > 翻译:[xiehurricane](https://github.com/xiehurricane) > 校对:[happyming](https://github.com/happyming) + + + + # 类型转换(Type Casting) ----------------- diff --git a/source/chapter2/19_Nested_Types.md b/source/chapter2/19_Nested_Types.md index 0db7d1da..12911bf5 100755 --- a/source/chapter2/19_Nested_Types.md +++ b/source/chapter2/19_Nested_Types.md @@ -1,6 +1,10 @@ > 翻译:[Lin-H](https://github.com/Lin-H) > 校对:[shinyzhu](https://github.com/shinyzhu) + + + + # 嵌套类型 ----------------- diff --git a/source/chapter2/20_Extensions.md b/source/chapter2/20_Extensions.md index cd014f1e..647e59b9 100755 --- a/source/chapter2/20_Extensions.md +++ b/source/chapter2/20_Extensions.md @@ -1,6 +1,10 @@ > 翻译:[lyuka](https://github.com/lyuka) > 校对:[Hawstein](https://github.com/Hawstein) + + + + #扩展(Extensions) ---- diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md index b8ffb090..32c00e8d 100755 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -1,6 +1,10 @@ > 翻译:[geek5nan](https://github.com/geek5nan) > 校对:[dabing1022](https://github.com/dabing1022) + + + + # 协议 ----------------- diff --git a/source/chapter2/22_Generics.md b/source/chapter2/22_Generics.md index ef69d439..ae6570a7 100755 --- a/source/chapter2/22_Generics.md +++ b/source/chapter2/22_Generics.md @@ -2,6 +2,10 @@ > 翻译:[takalard](https://github.com/takalard) > 校对:[lifedim](https://github.com/lifedim) + + + + # 泛型 ------ diff --git a/source/chapter2/23_Access_Control.md b/source/chapter2/23_Access_Control.md index cef454b5..697a29c4 100644 --- a/source/chapter2/23_Access_Control.md +++ b/source/chapter2/23_Access_Control.md @@ -1,6 +1,10 @@ > 翻译:[JaceFu](http://www.devtalking.com/) > 校对:[ChildhoodAndy](http://childhood.logdown.com) + + + + # 访问控制 ------------------ diff --git a/source/chapter2/24_Advanced_Operators.md b/source/chapter2/24_Advanced_Operators.md index 745c9da7..620ad392 100755 --- a/source/chapter2/24_Advanced_Operators.md +++ b/source/chapter2/24_Advanced_Operators.md @@ -1,6 +1,10 @@ > 翻译:[xielingwang](https://github.com/xielingwang) > 校对:[numbbbbb](https://github.com/numbbbbb) + + + + # 高级运算符 ----------------- diff --git a/source/chapter3/01_About_the_Language_Reference.md b/source/chapter3/01_About_the_Language_Reference.md index aafce2d3..34be3e40 100755 --- a/source/chapter3/01_About_the_Language_Reference.md +++ b/source/chapter3/01_About_the_Language_Reference.md @@ -1,6 +1,10 @@ > 翻译:[dabing1022](https://github.com/dabing1022) > 校对:[numbbbbb](https://github.com/numbbbbb) + + + + # 关于语言附注 ----------------- diff --git a/source/chapter3/02_Lexical_Structure.md b/source/chapter3/02_Lexical_Structure.md index ca1ac6a9..b77e642a 100755 --- a/source/chapter3/02_Lexical_Structure.md +++ b/source/chapter3/02_Lexical_Structure.md @@ -1,6 +1,10 @@ > 翻译:[superkam](https://github.com/superkam) > 校对:[numbbbbb](https://github.com/numbbbbb) + + + + # 词法结构 ----------------- diff --git a/source/chapter3/03_Types.md b/source/chapter3/03_Types.md index c2267554..b1336566 100755 --- a/source/chapter3/03_Types.md +++ b/source/chapter3/03_Types.md @@ -1,6 +1,10 @@ > 翻译:[lyuka](https://github.com/lyuka) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # 类型(Types) ----------------- diff --git a/source/chapter3/04_Expressions.md b/source/chapter3/04_Expressions.md index 30c2ec2e..199d4115 100755 --- a/source/chapter3/04_Expressions.md +++ b/source/chapter3/04_Expressions.md @@ -1,6 +1,10 @@ > 翻译:[sg552](https://github.com/sg552) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # 表达式(Expressions) ----------------- diff --git a/source/chapter3/05_Declarations.md b/source/chapter3/05_Declarations.md index 66fc4fcf..6be5a5b9 100755 --- a/source/chapter3/05_Declarations.md +++ b/source/chapter3/05_Declarations.md @@ -1,6 +1,10 @@ > 翻译:[marsprince](https://github.com/marsprince) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # 声明 ----------------- diff --git a/source/chapter3/06_Attributes.md b/source/chapter3/06_Attributes.md index fbf2e64f..7136e4db 100755 --- a/source/chapter3/06_Attributes.md +++ b/source/chapter3/06_Attributes.md @@ -1,6 +1,10 @@ > 翻译:[Hawstein](https://github.com/Hawstein) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # 特性 ----------------- diff --git a/source/chapter3/07_Patterns.md b/source/chapter3/07_Patterns.md index 3448a392..bfb56301 100755 --- a/source/chapter3/07_Patterns.md +++ b/source/chapter3/07_Patterns.md @@ -1,6 +1,10 @@ > 翻译:[honghaoz](https://github.com/honghaoz) > 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + + + + # 模式(Patterns) ----------------- diff --git a/source/chapter3/08_Generic_Parameters_and_Arguments.md b/source/chapter3/08_Generic_Parameters_and_Arguments.md index 06a078b0..853e78ee 100755 --- a/source/chapter3/08_Generic_Parameters_and_Arguments.md +++ b/source/chapter3/08_Generic_Parameters_and_Arguments.md @@ -1,6 +1,10 @@ > 翻译:[fd5788](https://github.com/fd5788) > 校对:[yankuangshi](https://github.com/yankuangshi), [stanzhai](https://github.com/stanzhai) + + + + # 泛型参数 --------- diff --git a/source/chapter3/09_Summary_of_the_Grammar.md b/source/chapter3/09_Summary_of_the_Grammar.md index 2e307e09..9328df89 100755 --- a/source/chapter3/09_Summary_of_the_Grammar.md +++ b/source/chapter3/09_Summary_of_the_Grammar.md @@ -1,6 +1,10 @@ > 翻译:[stanzhai](https://github.com/stanzhai) > 校对:[xielingwang](https://github.com/xielingwang) + + + + # 语法总结 _________________ diff --git a/source/chapter3/10_Statements.md b/source/chapter3/10_Statements.md index c9bf88f9..16f355b1 100755 --- a/source/chapter3/10_Statements.md +++ b/source/chapter3/10_Statements.md @@ -1,6 +1,10 @@ > 翻译:[coverxit](https://github.com/coverxit) > 校对:[numbbbbb](https://github.com/numbbbbb), [coverxit](https://github.com/coverxit), [stanzhai](https://github.com/stanzhai) + + + + # 语句 ----------------- diff --git a/source/chapter4/01_Access_Control.md b/source/chapter4/01_Access_Control.md index eef55359..b551ee39 100644 --- a/source/chapter4/01_Access_Control.md +++ b/source/chapter4/01_Access_Control.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Arya](http://weibo.com/littlekok/) > 校对:[老码团队翻译组-Oberyn](http://weibo.com/u/5241713117) + + + + # Access Control 权限控制的黑与白 如果您之前没有接触过权限控制,先来听一个小故事: diff --git a/source/chapter4/02_Type_Custom.md b/source/chapter4/02_Type_Custom.md index a204a110..3da85906 100644 --- a/source/chapter4/02_Type_Custom.md +++ b/source/chapter4/02_Type_Custom.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Tyrion](http://weibo.com/u/5241713117) > 校对:[老码团队翻译组-Oberyn](http://weibo.com/u/5241713117) + + + + # 造个类型不是梦-白话Swift类型创建 ----------------- diff --git a/source/chapter4/03_Ballons.md b/source/chapter4/03_Ballons.md index 9890a3a3..234563eb 100644 --- a/source/chapter4/03_Ballons.md +++ b/source/chapter4/03_Ballons.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Arya](http://weibo.com/littlekok/) > 校对:[老码团队翻译组-Jame](http://weibo.com/u/5241713117) + + + + # WWDC里面的那个“大炮打气球” ![Ballon playground](https://devimages.apple.com.edgekey.net/swift/images/swift-screenshot.jpg) diff --git a/source/chapter4/04_Interacting_with_C_Pointers.md b/source/chapter4/04_Interacting_with_C_Pointers.md index 3312baad..02f4e0ef 100644 --- a/source/chapter4/04_Interacting_with_C_Pointers.md +++ b/source/chapter4/04_Interacting_with_C_Pointers.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Relly](http://weibo.com/penguinliong/) > 校对:[老码团队翻译组-Tyrion](http://weibo.com/u/5241713117) + + + + # Swift与C语言指针友好合作 ----------------- diff --git a/source/chapter4/05_Value_and_Reference_Types.md b/source/chapter4/05_Value_and_Reference_Types.md index 049a8374..be81e51c 100644 --- a/source/chapter4/05_Value_and_Reference_Types.md +++ b/source/chapter4/05_Value_and_Reference_Types.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Arya](http://weibo.com/littlekok/) > 校对:[老码团队翻译组-Jame](http://weibo.com/u/5241713117) + + + + # Swift里的值类型与引用类型 ----------------- diff --git a/source/chapter4/06_access_control_&_protected.md b/source/chapter4/06_access_control_&_protected.md index f03e47ac..3afa7482 100644 --- a/source/chapter4/06_access_control_&_protected.md +++ b/source/chapter4/06_access_control_&_protected.md @@ -1,6 +1,10 @@ > 翻译:[老码团队翻译组-Arya](http://weibo.com/littlekok/) > 校对:[老码团队翻译组-Jame](http://weibo.com/u/5241713117) + + + + # 访问控制和protected -----------------