diff --git a/chapter1/01_swift.html b/chapter1/01_swift.html index c178cab0..4649973a 100644 --- a/chapter1/01_swift.html +++ b/chapter1/01_swift.html @@ -46,7 +46,7 @@ -
Swift 是一种新的编程语言,用于编写 iOS 和 OS X 应用程序。Swift 结合了 C 和 Objective-C 的优点并且不受C的兼容性的限制。Swift 使用安全的编程模式并添加了很多新特性,这将使编程更简单,扩展性更强,也更有趣。除此之外,Swift 还支持人见人爱的 Cocoa 和 Cocoa Touch 框架。拥有了这些特性,Swift将重新定义软件开发。
diff --git a/chapter1/02_a_swift_tour.html b/chapter1/02_a_swift_tour.html index 114fec6f..8d10334c 100644 --- a/chapter1/02_a_swift_tour.html +++ b/chapter1/02_a_swift_tour.html @@ -46,7 +46,7 @@ -通常来说,编程语言教程中的第一个程序应该在屏幕上打印“Hello, world”。在 Swift 中,可以用一行代码实现:
diff --git a/chapter1/chapter1.html b/chapter1/chapter1.html index 4e325c74..1399784a 100644 --- a/chapter1/chapter1.html +++ b/chapter1/chapter1.html @@ -46,7 +46,7 @@ -在本章中您将了解 Swift 的特性和开发历史,并对 Swift 有一个初步的了解。
diff --git a/chapter2/01_The_Basics.html b/chapter2/01_The_Basics.html index e27ee031..2036edc6 100644 --- a/chapter2/01_The_Basics.html +++ b/chapter2/01_The_Basics.html @@ -46,7 +46,7 @@ -Swift 是 iOS 和 OS X 应用开发的一门新语言。然而,如果你有 C 或者 Objective-C 开发经验的话,你会发现 Swift 的很多内容都是你熟悉的。
@@ -649,7 +649,7 @@ var currentLoginAttempt = 0请将你的代码中的非执行文本注释成提示或者笔记以方便你将来阅读。Swift 的编译器将会在编译代码时自动忽略掉注释部分。
Swift 中的注释与C 语言的注释非常相似。单行注释以双正斜杠作(//)为起始标记:
// this is a comment
-你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(/),终止标记为一个星号后跟随单个正斜杠(\/):
+你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(/*),终止标记为一个星号后跟随单个正斜杠(*/):
/* this is also a comment,
but written over multiple lines */
与C 语言多行注释不同的是,Swift 的多行注释可以嵌套在其它的多行注释之中。你可以先生成一个多行注释块,然后在这个注释块之中再嵌套成第二个多行注释。终止注释时先插入第二个注释块的终止标记,然后再插入第一个注释块的终止标记:
@@ -657,7 +657,11 @@ but written over multiple lines */ /* this is the second, nested multiline comment */ this is the end of the first multiline comment */通过运用嵌套多行注释,你可以快速方便的注释掉一大段代码,即使这段代码之中已经含有了多行注释块。
- +与其他大部分编程语言不同,Swift 并不强制要求你在每条语句的结尾处使用分号(;),当然,你也可以按照你自己的习惯添加分号。有一种情况下必须要用分号,即你打算在同一行内写多条独立的语句:
+let cat = "🐱"; println(cat)
+// prints "🐱"
+
String 是一个有序的字符集合,例如 "hello, world", "albatross"。Swift 字符串通过 String 类型来表示,也可以表示为 Character 类型值的集合。
diff --git a/chapter2/04_Collection_Types.html b/chapter2/04_Collection_Types.html index 66687f35..650a57f4 100644 --- a/chapter2/04_Collection_Types.html +++ b/chapter2/04_Collection_Types.html @@ -46,7 +46,7 @@ -函数是用来完成特定任务的独立的代码块。你给一个函数起一个合适的名字,用来标示函数做什么,并且当函数需要执行的时候,这个名字会被“调用”。
diff --git a/chapter2/07_Closures.html b/chapter2/07_Closures.html index b7f0dbdc..2cde4b3e 100644 --- a/chapter2/07_Closures.html +++ b/chapter2/07_Closures.html @@ -46,7 +46,7 @@ -本章介绍了 Swift 的各种特性及其使用方法,是全书的核心部分。
diff --git a/chapter3/01_About_the_Language_Reference.html b/chapter3/01_About_the_Language_Reference.html index 3e2b5026..0f74ddfb 100644 --- a/chapter3/01_About_the_Language_Reference.html +++ b/chapter3/01_About_the_Language_Reference.html @@ -46,7 +46,7 @@ -Swift 是苹果在 WWDC 2014 上发布的一款全新的编程语言,本书译自苹果官方的 Swift 教程《The Swift Programming Language》。
diff --git a/manifest.appcache b/manifest.appcache index eedc3565..5e27c327 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# Revision 1401943865089 +# Revision 1401951667607 CACHE: index.html @@ -76,8 +76,8 @@ gitbook/jsrepl/sandbox.html gitbook/jsrepl/sandbox.js gitbook/print.css gitbook/style.css -gitbook/plugins/gitbook-plugin-mathjax/plugin.js gitbook/plugins/gitbook-plugin-mixpanel/plugin.js +gitbook/plugins/gitbook-plugin-mathjax/plugin.js NETWORK: * \ No newline at end of file diff --git a/search_index.json b/search_index.json index 2eb50050..3dfb31cc 100644 --- a/search_index.json +++ b/search_index.json @@ -1 +1 @@ -{"version":"0.5.2","fields":[{"name":"title","boost":10},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"index.html#gitbook_3":["2014","languag","program","swift","undefinedundefin","wwdc"],"chapter1/01_swift.html#gitbook_4":["arc","automat","c","cocoa","cocoa的基础上构建框架栈并将其标准化。objective-c","count","c的兼容性的限制。swift","foundat","hello","io","objective-c","os","refer","swift","touch","undefinedundefin","world","x"],"chapter1/02_a_swift_tour.html#gitbook_5":["0","0..3","0..time","0.0","1","10","100","103","11","12","13","16","19","2","2.5","20","25","3","3.0","3.1","3.59","3.69","3.79","4","42","43","5","5.2","50","597","69105","7","7.simpledescript","70","70.0","75","8","87","8:09","9","9.9","94","a.adjust","a.simpledescript","ac","ace.toraw","acerawvalu","add","addon","addone(numb","adescript","adjust","amount","anoth","anotherproperti","ant","anycommonel","anycommonelements([1","appl","applese","applesummari","area","b","b.adjust","b.simpledescript","bdescript","blue","bool","bottl","c","captain","card","card(rank","card添加一个方法,创建一副完整的扑克牌并把每张牌的rank和suit","case","catfish","celeri","chees","class","club","condit","condition(item","convertedrank","convertedrank.simpledescript","count","counter","counter.incrementby(2","cucumb","dai","default","deinit","diamond","dictionary