diff --git a/chapter1/01_swift.html b/chapter1/01_swift.html index 8cd2f0cc..f28cdc35 100644 --- a/chapter1/01_swift.html +++ b/chapter1/01_swift.html @@ -46,7 +46,7 @@ -
只有 getter 没有 setter 的计算属性就是只读计算属性。只读计算属性总是返回一个值,可以通过点运算符访问,但不能设置新的值。
+<<<<<<< HEAD
++注意:
+必须使用
var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let关键字只用来声明常量属性,表示初始化后再也无法修改的值。注意:
必须使用
var关键字定义计算属性,包括只读计算属性,因为它们的值不是固定的。let关键字只用来声明常量属性,表示初始化后再也无法修改的值。@@ -778,6 +782,10 @@ println("the volume of fourByFiveByTwo is \(fourByFiveByTwo.volume)")
willSet监视器会将新的属性值作为固定参数传入,在willSet的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称newValue表示。类似地,
+didSet监视器会将旧的属性值作为参数传入,可以为该参数命名或者使用默认参数名oldValue。<<<<<<< HEAD
++注意:
+
willSet和didSet监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。注意:
willSet和didSet监视器在属性初始化过程中不会被调用,它们只会当属性的值在初始化之外的地方被设置时被调用。diff --git a/chapter2/11_Methods.html b/chapter2/11_Methods.html index e6450517..0778d16c 100644 --- a/chapter2/11_Methods.html +++ b/chapter2/11_Methods.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/12_Subscripts.html b/chapter2/12_Subscripts.html index c54e8553..b4e30869 100644 --- a/chapter2/12_Subscripts.html +++ b/chapter2/12_Subscripts.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/13_Inheritance.html b/chapter2/13_Inheritance.html index de0485c0..5816e383 100644 --- a/chapter2/13_Inheritance.html +++ b/chapter2/13_Inheritance.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/14_Initialization.html b/chapter2/14_Initialization.html index 957224cc..f0978e7f 100644 --- a/chapter2/14_Initialization.html +++ b/chapter2/14_Initialization.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/15_Deinitialization.html b/chapter2/15_Deinitialization.html index 7bcdc3ba..b134969a 100644 --- a/chapter2/15_Deinitialization.html +++ b/chapter2/15_Deinitialization.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/16_Automatic_Reference_Counting.html b/chapter2/16_Automatic_Reference_Counting.html index 23818d6a..5ac54f2b 100644 --- a/chapter2/16_Automatic_Reference_Counting.html +++ b/chapter2/16_Automatic_Reference_Counting.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/17_Optional_Chaining.html b/chapter2/17_Optional_Chaining.html index c98610b6..5d4d5321 100644 --- a/chapter2/17_Optional_Chaining.html +++ b/chapter2/17_Optional_Chaining.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/18_Type_Casting.html b/chapter2/18_Type_Casting.html index c485f97c..67dae1c8 100644 --- a/chapter2/18_Type_Casting.html +++ b/chapter2/18_Type_Casting.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/19_Nested_Types.html b/chapter2/19_Nested_Types.html index 49284a1a..441e8e5d 100644 --- a/chapter2/19_Nested_Types.html +++ b/chapter2/19_Nested_Types.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/20_Extensions.html b/chapter2/20_Extensions.html index 86fc54ae..360136f8 100644 --- a/chapter2/20_Extensions.html +++ b/chapter2/20_Extensions.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/21_Protocols.html b/chapter2/21_Protocols.html index a04c1d81..4d2bcdc7 100644 --- a/chapter2/21_Protocols.html +++ b/chapter2/21_Protocols.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/22_Generics.html b/chapter2/22_Generics.html index aaabbef8..8e6ec621 100644 --- a/chapter2/22_Generics.html +++ b/chapter2/22_Generics.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/23_Advanced_Operators.html b/chapter2/23_Advanced_Operators.html index 09195103..28b915d0 100644 --- a/chapter2/23_Advanced_Operators.html +++ b/chapter2/23_Advanced_Operators.html @@ -46,7 +46,7 @@ -+diff --git a/chapter2/chapter2.html b/chapter2/chapter2.html index f89d3a11..0197e3eb 100644 --- a/chapter2/chapter2.html +++ b/chapter2/chapter2.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/01_About_the_Language_Reference.html b/chapter3/01_About_the_Language_Reference.html index 6d5611fe..6c7927d8 100644 --- a/chapter3/01_About_the_Language_Reference.html +++ b/chapter3/01_About_the_Language_Reference.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/02_Lexical_Structure.html b/chapter3/02_Lexical_Structure.html index a2e6da75..faf2fe49 100644 --- a/chapter3/02_Lexical_Structure.html +++ b/chapter3/02_Lexical_Structure.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/03_Types.html b/chapter3/03_Types.html index 1addc70e..db888e47 100644 --- a/chapter3/03_Types.html +++ b/chapter3/03_Types.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/04_Expressions.html b/chapter3/04_Expressions.html index d63f5c38..d7483066 100644 --- a/chapter3/04_Expressions.html +++ b/chapter3/04_Expressions.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/05_Declarations.html b/chapter3/05_Declarations.html index 5094df91..c309bd05 100644 --- a/chapter3/05_Declarations.html +++ b/chapter3/05_Declarations.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/06_Attributes.html b/chapter3/06_Attributes.html index 1cf652e0..24ad424e 100644 --- a/chapter3/06_Attributes.html +++ b/chapter3/06_Attributes.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/07_Patterns.html b/chapter3/07_Patterns.html index 53abf8fa..3f329b88 100644 --- a/chapter3/07_Patterns.html +++ b/chapter3/07_Patterns.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/08_Generic_Parameters_and_Arguments.html b/chapter3/08_Generic_Parameters_and_Arguments.html index 49e02344..65d05530 100644 --- a/chapter3/08_Generic_Parameters_and_Arguments.html +++ b/chapter3/08_Generic_Parameters_and_Arguments.html @@ -46,7 +46,7 @@ -+diff --git a/chapter3/09_Summary_of_the_Grammar.html b/chapter3/09_Summary_of_the_Grammar.html index 1d430619..eff607e1 100644 --- a/chapter3/09_Summary_of_the_Grammar.html +++ b/chapter3/09_Summary_of_the_Grammar.html @@ -44,7 +44,7 @@ -+diff --git a/chapter3/10_Statements.html b/chapter3/10_Statements.html index 5d4b8bd1..69d9f9ac 100644 --- a/chapter3/10_Statements.html +++ b/chapter3/10_Statements.html @@ -46,7 +46,7 @@ -