Skip to content

Commit 98c57c4

Browse files
author
DianQK
committed
Merge pull request #1 from numbbbbb/gh-pages
pull
2 parents 727346d + 5769c28 commit 98c57c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5688
-4336
lines changed

README.md

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,59 @@
33

44
中文版Apple官方Swift教程《The Swift Programming Language》
55

6-
中文Swift社区[Swiftist](http://swiftist.org/),新社区,正在建设中,感兴趣的朋友可以一起参与进来。
6+
[英文原版](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097-CH3-ID0)
77

8-
**如果想帮忙翻译或者校对,请加QQ群:364279588,谢谢!**
8+
**如果想帮忙翻译或者校对,请加QQ群:480616051,谢谢!**
99

1010
# 在线阅读
1111

12-
使用Gitbook制作,可以直接[在线阅读](http://numbbbbb.github.io/the-swift-programming-language-in-chinese/)
13-
14-
# 电子书下载
15-
16-
CocoaChina精校PDF→[点我下载](http://vdisk.weibo.com/s/EhsPPzRRQ5CZ/1402621206)
17-
18-
其他格式可以通过PDF转换
12+
使用Gitbook制作,可以直接[在线阅读](http://swiftguide.cn/)
1913

2014
# 当前阶段
2115

22-
文章已经全部翻译完成,当前阶段为自由校对阶段,可以随意提issue和pr。
23-
24-
25-
# 译者记录
16+
已经更新到Swift 2.0,对应苹果官方文档7.23的更新。
17+
18+
# 2.0译者记录
19+
20+
- About Swift ([xtymichael](https://github.com/xtymichael)
21+
- A Swift Tour([xtymichael](https://github.com/xtymichael)
22+
- The Basics([xtymichael](https://github.com/xtymichael)
23+
- Basic Operators([AlanMelody](https://github.com/AlanMelody)
24+
- Strings and Characters([DianQK](https://github.com/DianQK)
25+
- Collection Types([AlanMelody](https://github.com/AlanMelody)
26+
- Control Flow([AlanMelody](https://github.com/AlanMelody)
27+
- Functions([dreamkidd](https://github.com/dreamkidd)
28+
- Closures([100mango](https://github.com/100mango)
29+
- Enumerations([futantan](https://github.com/futantan)
30+
- Classes and Structures([SkyJean](https://github.com/SkyJean)
31+
- Properties([yangsiy](https://github.com/yangsiy)
32+
- Methods([DianQK](https://github.com/DianQK)
33+
- Subscripts([shanksyang](https://github.com/shanksyang)
34+
- Inheritance([shanksyang](https://github.com/shanksyang)
35+
- Initialization([chenmingbiao](https://github.com/chenmingbiao)
36+
- Deinitialization([chenmingbiao](https://github.com/chenmingbiao)
37+
- Automatic Reference Counting([Channe](https://github.com/Channe)
38+
- Optional Chaining([lyojo](https://github.com/lyojo)
39+
- Error Handling([lyojo](https://github.com/lyojo)
40+
- Type Casting([yangsiy](https://github.com/yangsiy)
41+
- Nested Types([SergioChan](https://github.com/SergioChan)
42+
- Extensions([shanksyang](https://github.com/shanksyang)
43+
- Protocols([futantan](https://github.com/futantan)
44+
- Generics([SergioChan](https://github.com/SergioChan)
45+
- Access Control([mmoaay](https://github.com/mmoaay)
46+
- Advanced Operators([buginux](https://github.com/buginux)
47+
- About the Language Reference([KYawn](https://github.com/KYawn)
48+
- Lexical Structure([buginux](https://github.com/buginux)
49+
- Types([EudeMorgen](https://github.com/EudeMorgen)
50+
- Expressions([EudeMorgen](https://github.com/EudeMorgen)
51+
- Statements([littledogboy](https://github.com/littledogboy)
52+
- Declarations([Lenhoon](https://github.com/Lenhoon)
53+
- Attributes([KYawn](https://github.com/KYawn)
54+
- Patterns([ray16897188](https://github.com/ray16897188)
55+
- Generic Parameters and Arguments([wardenNScaiyi](https://github.com/wardenNScaiyi)
56+
- Summary of the Grammar([miaosiqi](https://github.com/miaosiqi)
57+
58+
# 1.0译者记录
2659

2760
* 欢迎使用 Swift
2861
* 关于 Swift ([numbbbbb])
@@ -171,4 +204,4 @@ CocoaChina精校PDF→[点我下载](http://vdisk.weibo.com/s/EhsPPzRRQ5CZ/14026
171204
[Lin-H]:https://github.com/Lin-H
172205
[takalard]:https://github.com/takalard
173206
[dabing1022]:https://github.com/dabing1022
174-
[marsprince]:https://github.com/marsprince
207+
[marsprince]:https://github.com/marsprince

config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "The Swift Programming Language 中文版",
3+
"introduction": "中文版《The Swift Programming Language》",
4+
"path": {
5+
"content": "source",
6+
"toc": "source/SUMMARY.md",
7+
"readme": "source/README.md"
8+
}
9+
}

cover/background.jpg

29.8 KB
Loading

cover/cover.jpg

1.32 MB
Loading

cover/logo.png

4.29 KB
Loading

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55

6-
<meta http-equiv="refresh" content="0; url=http://numbbbbb.gitbooks.io/-the-swift-programming-language-/content/" />
6+
<meta http-equiv="refresh" content="0; url=http://wiki.jikexueyuan.com/project/swift/" />
77

88

99

source-tw/chapter1/02_a_swift_tour.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func lessThanTen(number: Int) -> Bool {
301301
return number < 10
302302
}
303303
var numbers = [20, 19, 7, 12]
304-
hasAnyMatches(numbers, lessThanTen)
304+
hasAnyMatches(numbers, condition: lessThanTen)
305305
```
306306

307307
函數實際上是一種特殊的閉包,你可以使用`{}`來創建一個匿名閉包。使用`in`將參數和返回值類型聲明與閉包涵數體進行分離。
@@ -649,7 +649,7 @@ let bDescription = b.simpleDescription
649649
650650
注意聲明`SimpleStructure`時候`mutating`關鍵字用來標記一個會修改結構體的方法。`SimpleClass`的聲明不需要標記任何方法因為類中的方法經常會修改類。
651651

652-
使用`extension`來為現有的類型添加功能,比如新的方法和參數。你可以使用擴展來改造定義在別處,甚至是從外部庫或者框架引入的一個類型,使得這個類型遵循某個協議。
652+
使用`extension`來為現有的類型添加功能,比如新的方法和計算屬性。你可以使用擴展來改造定義在別處,甚至是從外部庫或者框架引入的一個類型,使得這個類型遵循某個協議。
653653

654654
```swift
655655
extension Int: ExampleProtocol {

source-tw/chapter2/11_Methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ ovenLight.next()
225225

226226
```swift
227227
class SomeClass {
228-
class func someTypeMethod() {
228+
static func someTypeMethod() {
229229
// type method implementation goes here
230230
}
231231
}

source/README.md

Lines changed: 75 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,78 @@
1-
> Swift 兴趣交流群:`305014012`,307017261(已满)
2-
> [Swift 开发者社区](http://swiftist.org)
1+
# 2.0 新的开始
32

4-
<!-- -->
5-
> 如果你觉得这个项目不错,请[点击Star一下](https://github.com/numbbbbb/the-swift-programming-language-in-chinese),您的支持是我们最大的动力。
3+
> Swift 兴趣交流群:`131595168`, `146932759`, `151336833`, `153549217`. **加入一个群即可,请勿重复添加**
4+
5+
> <a target='_blank' href="http://swiftist.org">Swift 开发者社区</a>
6+
7+
> <a target='_blank' href="https://github.com/ipader/SwiftGuide">Swift 资源汇总</a>
8+
9+
> <a target='_blank' href="http://swiftsandbox.io">Swift 优秀newsletter</a>
610
711
<!-- -->
8-
> 关于文档中翻译错误,逻辑错误以及疑难问题答疑,请关注["@老码团队"](http://weibo.com/u/5241713117
9-
)官方微博,会有技术人员统一收集答疑
10-
11-
12-
# The Swift Programming Language 中文版####
13-
14-
###这一次,让中国和世界同步
15-
16-
现在是6月12日凌晨4:38,我用了整整一晚上的时间来进行最后的校对,终于可以在12日拿出一个可以发布的版本。
17-
18-
9天时间,1317个 Star,310个 Fork,超过30人参与翻译和校对工作,项目最高排名GitHub总榜第4。
19-
20-
设想过很多遍校对完成时的场景,仰天大笑还是泪流满面?真正到了这一刻才发现,疲倦已经不允许我有任何情绪。
21-
22-
说实话,刚开始发起项目的时候完全没想到会发展成今天这样,我一度计划自己一个人翻译完整本书。万万没想到,会有这么多的人愿意加入并贡献出自己的力量。
23-
24-
coverxit发给我最后一份文档的时候说,我要去背单词了,我问他,周末要考六级?他说是的。
25-
26-
pp-prog告诉我,这几天太累了,校对到一半睡着了,醒来又继续做。2点17分,发给我校对完成的文档。
27-
28-
lifedim说他平时12点就会睡,1点47分,发给我校对后的文档。
29-
30-
团队里每个人都有自己的事情,上班、上学、创业,但是我们只用了9天就完成整本书的翻译。我不知道大家付出了多少,牺牲了多少,但是我知道,他们的付出必将被这些文字记录下来,即使再过10年,20年,依然熠熠生辉,永不被人遗忘。
31-
32-
全体人员名单(排名不分先后):
33-
34-
- [numbbbbb](https://github.com/numbbbbb)
35-
- [stanzhai](https://github.com/stanzhai)
36-
- [coverxit](https://github.com/coverxit)
37-
- [wh1100717](https://github.com/wh1100717)
38-
- [TimothyYe](https://github.com/TimothyYe)
39-
- [honghaoz](https://github.com/honghaoz)
40-
- [lyuka](https://github.com/lyuka)
41-
- [JaySurplus](https://github.com/JaySurplus)
42-
- [Hawstein](https://github.com/Hawstein)
43-
- [geek5nan](https://github.com/geek5nan)
44-
- [yankuangshi](https://github.com/yankuangshi)
45-
- [xielingwang](https://github.com/xielingwang)
46-
- [yulingtianxia](https://github.com/yulingtianxia)
47-
- [twlkyao](https://github.com/twlkyao)
48-
- [dabing1022](https://github.com/dabing1022)
49-
- [vclwei](https://github.com/vclwei)
50-
- [fd5788](https://github.com/fd5788)
51-
- [siemenliu](https://github.com/siemenliu)
52-
- [youkugems](https://github.com/youkugems)
53-
- [haolloyin](https://github.com/haolloyin)
54-
- [wxstars](https://github.com/wxstars)
55-
- [IceskYsl](https://github.com/IceskYsl)
56-
- [sg552](https://github.com/sg552)
57-
- [superkam](https://github.com/superkam)
58-
- [zac1st1k](https://github.com/zac1st1k)
59-
- [bzsy](https://github.com/bzsy)
60-
- [pyanfield](https://github.com/pyanfield)
61-
- [ericzyh](https://github.com/ericzyh)
62-
- [peiyucn](https://github.com/peiyucn)
63-
- [sunfiled](https://github.com/sunfiled)
64-
- [lzw120](https://github.com/lzw120)
65-
- [viztor](https://github.com/viztor)
66-
- [wongzigii](https://github.com/wongzigii)
67-
- [umcsdon](https://github.com/umcsdon)
68-
- [zq54zquan](https://github.com/zq54zquan)
69-
- [xiehurricane](https://github.com/xiehurricane)
70-
- [Jasonbroker](https://github.com/Jasonbroker)
71-
- [tualatrix](https://github.com/tualatrix)
72-
- [pp-prog](https://github.com/pp-prog)
73-
- [088haizi](https://github.com/088haizi)
74-
- [baocaixiong](https://github.com/baocaixiong)
75-
- [yeahdongcn](https://github.com/yeahdongcn)
76-
- [shinyzhu](https://github.com/shinyzhu)
77-
- [lslxdx](https://github.com/lslxdx)
78-
- [Evilcome](https://github.com/Evilcome)
79-
- [zqp](https://github.com/zqp)
80-
- [NicePiao](https://github.com/NicePiao)
81-
- [LunaticM](https://github.com/LunaticM)
82-
- [menlongsheng](https://github.com/menlongsheng)
83-
- [lifedim](https://github.com/lifedim)
84-
- [happyming](https://github.com/happyming)
85-
- [bruce0505](https://github.com/bruce0505)
86-
- [Lin-H](https://github.com/Lin-H)
87-
- [takalard](https://github.com/takalard)
88-
- [dabing1022](https://github.com/dabing1022)
89-
- [marsprince](https://github.com/marsprince)
12+
> 如果您觉得这个项目不错,请<a target='_blank' href="https://github.com/numbbbbb/the-swift-programming-language-in-chinese">点击Star一下</a>,您的支持是我们最大的动力。
13+
14+
## 1
15+
16+
开源项目完成难,维护更难。
17+
18+
大家看到的是发布时的瞩目和荣耀,却没有看到项目本身质量不高、错误频出。这并不是翻译者和校对者的问题,他们已经付出了足够的努力。真正的问题在我,没有建立起长期的维护团队,因此后期的校对和更新都难以实施。
19+
20+
1.0发布之后,我们就再也没能和苹果的文档同步。语法错误、编译不通过、语言不通顺,阅读量直线下降,最低时每天只有不到1000人访问。
21+
22+
6月9日,calvingit发了一个issue“准备翻译2.0版本吗”,我没有回复,应该已经没人关注这个项目了吧,我想。
23+
24+
## 2
25+
26+
我错了。
27+
28+
![](https://raw.githubusercontent.com/numbbbbb/the-swift-programming-language-in-chinese/gh-pages/swift%202.0%E5%BC%95%E7%94%A8%E5%9B%BE%E7%89%87/1.png)
29+
30+
![](https://raw.githubusercontent.com/numbbbbb/the-swift-programming-language-in-chinese/gh-pages/swift%202.0%E5%BC%95%E7%94%A8%E5%9B%BE%E7%89%87/2.png)
31+
32+
![](https://raw.githubusercontent.com/numbbbbb/the-swift-programming-language-in-chinese/gh-pages/swift%202.0%E5%BC%95%E7%94%A8%E5%9B%BE%E7%89%87/3.png)
33+
34+
![](https://raw.githubusercontent.com/numbbbbb/the-swift-programming-language-in-chinese/gh-pages/swift%202.0%E5%BC%95%E7%94%A8%E5%9B%BE%E7%89%87/4.png)
35+
36+
![](https://raw.githubusercontent.com/numbbbbb/the-swift-programming-language-in-chinese/gh-pages/swift%202.0%E5%BC%95%E7%94%A8%E5%9B%BE%E7%89%87/5.png)
37+
38+
在我没有任何回复的情况下,不到一天时间,有五位朋友报名。看到这些回复的时候我真的很惊讶,也很感动,无论这个项目存在多少问题,只要有人关注,有人愿意为它付出,那我还有什么理由放弃呢?
39+
40+
6月28日8点55分,Swift 2.0翻译正式启动。按下发送按钮后,我不停的刷新页面,半个小时过去了,一个回复都没有。“还是不行啊”“如果再过一个小时没人回复我就把issue删掉”,类似的念头不断出现,又不断消失。
41+
42+
9:35,xtymichael第一个回复,而且一下就认领了三篇!接下来就是不断的回复认领,到中午已经有超过一半章节被认领。
43+
44+
第二天早晨,37个章节全部认领完毕。
45+
46+
## 3
47+
48+
经过一个多月的努力,我们终于完成了文档的更新。听起来似乎没什么,确实,从1到n总是没有从0到1那么振奋人心。不过真正参与了才知道,修改往往比创造更麻烦,一个需要耐心,一个需要激情,前者往往得不到应有的重视。
49+
50+
但是我还是想尽最大可能去感谢他们,这个项目能走到今天,靠的不是我,是那个issue,是那些回复,是这几十个兄弟在工作学习的空闲敲下的每一个字符。而我能做的,只是在每篇文章的开头,那个所有人都会忽略的地方,加上他们的ID。
51+
52+
下次你再打开这篇文档,可以多看看那些列在最上方的ID,哪怕不去follow和star,只是看一眼就好。他们的所有努力和付出,就存在于这短暂的一瞥中。
53+
54+
Swift 2.0 参与者名单(按照章节顺序):
55+
- [xtymichael](https://github.com/xtymichael)
56+
- [AlanMelody](https://github.com/AlanMelody)
57+
- [DianQK](https://github.com/DianQK)
58+
- [dreamkidd](https://github.com/dreamkidd)
59+
- [100mango](https://github.com/100mango)
60+
- [futantan](https://github.com/futantan)
61+
- [SkyJean](https://github.com/SkyJean)
62+
- [yangsiy](https://github.com/yangsiy)
63+
- [shanksyang](https://github.com/shanksyang)
64+
- [chenmingbiao](https://github.com/chenmingbiao)
65+
- [Channe](https://github.com/Channe)
66+
- [lyojo](https://github.com/lyojo)
67+
- [SergioChan](https://github.com/SergioChan)
68+
- [mmoaay](https://github.com/mmoaay)
69+
- [buginux](https://github.com/buginux)
70+
- [KYawn](https://github.com/KYawn)
71+
- [EudeMorgen](https://github.com/EudeMorgen)
72+
- [littledogboy](https://github.com/littledogboy)
73+
- [Lenhoon](https://github.com/Lenhoon)
74+
- [ray16897188](https://github.com/ray16897188)
75+
- [wardenNScaiyi](https://github.com/wardenNScaiyi)
76+
- [miaosiqi](https://github.com/miaosiqi)
77+
78+
最后,感谢<a target='_blank' href="http://wiki.jikexueyuan.com/">极客学院</a>提供的wiki系统,在国内访问起来速度很快,优化后的样式看起来也更舒服。

source/SUMMARY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* [关于 Swift](chapter1/01_swift.md)
55
* [Swift 初见](chapter1/02_a_swift_tour.md)
66
* [Swift 版本历史记录](chapter1/03_revision_history.md)
7+
* [Swift 1.0 发布内容](v1.0.md)
78
* [Swift 教程](chapter2/chapter2.md)
89
* [基础部分](chapter2/01_The_Basics.md)
910
* [基本运算符](chapter2/02_Basic_Operators.md)
@@ -30,7 +31,7 @@
3031
* [泛型](chapter2/23_Generics.md)
3132
* [权限控制](chapter2/24_Access_Control.md)
3233
* [高级操作符](chapter2/25_Advanced_Operators.md)
33-
* [语言参考](chapter3/chapter3.md)
34+
* 语言参考
3435
* [关于语言参考](chapter3/01_About_the_Language_Reference.md)
3536
* [词法结构](chapter3/02_Lexical_Structure.md)
3637
* [类型](chapter3/03_Types.md)
@@ -41,7 +42,7 @@
4142
* [模式](chapter3/07_Patterns.md)
4243
* [泛型参数](chapter3/08_Generic_Parameters_and_Arguments.md)
4344
* [语法总结](chapter3/09_Summary_of_the_Grammar.md)
44-
* [苹果官方Blog官方翻译](chapter4/chapter4.md)
45+
* 苹果官方Blog官方翻译
4546
* [Access Control 权限控制的黑与白](chapter4/01_Access_Control.md)
4647
* [造个类型不是梦-白话Swift类型创建](chapter4/02_Type_Custom.md)
4748
* [WWDC里面的那个“大炮打气球”](chapter4/03_Ballons.md)

0 commit comments

Comments
 (0)