Merge branch 'gh-pages' of https://github.com/coverxit/the-swift-programming-language-in-chinese into gh-pages
Conflicts: source/chapter2/05_Control_Flow.md
This commit is contained in:
@ -10,8 +10,11 @@
|
||||
- [For 循环](#for_loops)
|
||||
- [While 循环](#while_loops)
|
||||
- [条件语句](#conditional_statement)
|
||||
|
||||
- [控制传递语句(Control Transfer Statements)](#control_transfer_statements)
|
||||
|
||||
|
||||
|
||||
Swift提供了类似 C 语言的流程控制结构,包括可以多次执行任务的`for`和`while`循环,基于特定条件选择执行不同代码分支的`if`和`switch`语句,还有控制流程跳转到其他代码的`break`和`continue`语句。
|
||||
|
||||
除了 C 语言里面传统的for条件递增(`for-condition-increment`)循环,Swift 还增加了`for-in`循环,用来更简单地遍历数组(array),字典(dictionary),区间(range),字符串(string)和其他序列类型。
|
||||
|
||||
Reference in New Issue
Block a user