> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swift/flow.md).

# flow control

🚧 施工中

[Swift](/ios/swift.md) ⟩ flow control

{% hint style="success" %}
a [statement](/ios/swift/statement.md) that controls the <mark style="color:yellow;">**flow of execution**</mark> in a program.
{% endhint %}

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="success" %}
Swift provides a variety of <mark style="color:purple;">**control flow**</mark> [statement](/ios/swift/statement.md)s. These include：

* [loop](/ios/swift/flow/loop.md) statements to perform a task <mark style="color:yellow;">**multiple times**</mark>.
* [branch](/ios/swift/flow/branch.md) statements to execute <mark style="color:yellow;">**different branches**</mark> of code based on certain <mark style="color:yellow;">**conditions**</mark>.
* [control transfer](/ios/swift/flow/transfer.md) statements to <mark style="color:yellow;">**transfer**</mark> the flow of execution to <mark style="color:yellow;">**another point**</mark> in your code.
  {% endhint %}
  {% endtab %}

{% tab title="🔴 主題" %}

* <mark style="color:yellow;">**types of**</mark>**&#x20;**<mark style="color:purple;">**control flow**</mark> [statement](/ios/swift/statement.md)s
  * [loop](/ios/swift/flow/loop.md)
    * [for...in](/ios/swift/flow/loop/for...in.md), while 🚧, repeat...while 🚧
  * [branch](/ios/swift/flow/branch.md)
    * [if](/ios/swift/flow/branch/if.md), [switch](/ios/swift/flow/branch/switch.md), [guard](/ios/swift/flow/branch/guard.md)
  * [control transfer](/ios/swift/flow/transfer.md)
    * break, continue, fallthrough, throw, return 🚧
      {% endtab %}

{% tab title="👥 相關" %}

* <mark style="color:purple;">**flow control**</mark> is a [statement](/ios/swift/statement.md). (control flow statement)
  {% endtab %}

{% tab title="📘 手冊" %}

* [ ] [Statements](https://docs.swift.org/swift-book/ReferenceManual/Statements.html)
  {% endtab %}
  {% endtabs %}
