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 @@ -
+
diff --git a/chapter1/02_a_swift_tour.html b/chapter1/02_a_swift_tour.html index 27eadaf3..459a366d 100644 --- a/chapter1/02_a_swift_tour.html +++ b/chapter1/02_a_swift_tour.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter1/GuidedTour.playground.zip b/chapter1/GuidedTour.playground.zip deleted file mode 100644 index 13e2c05e..00000000 Binary files a/chapter1/GuidedTour.playground.zip and /dev/null differ diff --git a/chapter1/chapter1.html b/chapter1/chapter1.html index bf045def..5309c23f 100644 --- a/chapter1/chapter1.html +++ b/chapter1/chapter1.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/01_The_Basics.html b/chapter2/01_The_Basics.html index 3a88c6eb..2cf45e8b 100644 --- a/chapter2/01_The_Basics.html +++ b/chapter2/01_The_Basics.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/02_Basic_Operators.html b/chapter2/02_Basic_Operators.html index 3fddfe29..23adf489 100644 --- a/chapter2/02_Basic_Operators.html +++ b/chapter2/02_Basic_Operators.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/03_Strings_and_Characters.html b/chapter2/03_Strings_and_Characters.html index 2e8c4dd0..36baab00 100644 --- a/chapter2/03_Strings_and_Characters.html +++ b/chapter2/03_Strings_and_Characters.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/04_Collection_Types.html b/chapter2/04_Collection_Types.html index bbfc0482..9cf96acd 100644 --- a/chapter2/04_Collection_Types.html +++ b/chapter2/04_Collection_Types.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/05_Control_Flow.html b/chapter2/05_Control_Flow.html index 19448b10..92a155bd 100644 --- a/chapter2/05_Control_Flow.html +++ b/chapter2/05_Control_Flow.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/06_Functions.html b/chapter2/06_Functions.html index 939c55c4..59f7e3fc 100644 --- a/chapter2/06_Functions.html +++ b/chapter2/06_Functions.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/07_Closures.html b/chapter2/07_Closures.html index 29c8d9d1..d824f3d5 100644 --- a/chapter2/07_Closures.html +++ b/chapter2/07_Closures.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/08_Enumerations.html b/chapter2/08_Enumerations.html index ccc5b888..2ced1b8f 100644 --- a/chapter2/08_Enumerations.html +++ b/chapter2/08_Enumerations.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/09_Classes_and_Structures.html b/chapter2/09_Classes_and_Structures.html index 3aff8ef5..0c0b2557 100644 --- a/chapter2/09_Classes_and_Structures.html +++ b/chapter2/09_Classes_and_Structures.html @@ -46,7 +46,7 @@ -
+
diff --git a/chapter2/10_Properties.html b/chapter2/10_Properties.html index bea227b2..1b5ab6f5 100644 --- a/chapter2/10_Properties.html +++ b/chapter2/10_Properties.html @@ -46,7 +46,7 @@ -
+
@@ -736,6 +736,10 @@ println("square.origin is now at (\(square.origin.x), \(square.origin.y))&q

只读计算属性

只有 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

+
+

注意:

+

willSetdidSet监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。

注意:

willSetdidSet监视器在属性初始化过程中不会被调用,它们只会当属性的值在初始化之外的地方被设置时被调用。

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 @@ -
+
diff --git a/chapter3/chapter3.html b/chapter3/chapter3.html index 45ce0955..ca7fa094 100644 --- a/chapter3/chapter3.html +++ b/chapter3/chapter3.html @@ -46,7 +46,7 @@ -
+
diff --git a/index.html b/index.html index 87dc1047..0e4ff64e 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@ -
+
diff --git a/manifest.appcache b/manifest.appcache index cfeb55ab..a6dddfd9 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# Revision 1402809661160 +# Revision 1402840691921 CACHE: index.html