> 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/loop.md).

# loop

🚧 施工中

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

{% hint style="success" %}
a [statement](/ios/swift/statement.md) that allows a <mark style="color:yellow;">**block of code**</mark> to be executed <mark style="color:orange;">**repeatedly**</mark>.
{% endhint %}

{% tabs %}
{% tab title="📗 參考" %}

* [x] Sundell ⟩ [Loops](https://www.swiftbysundell.com/basics/loops/)
* [ ] Sarun ⟩ [How to get index and value from for loop in Swift](https://sarunw.com/posts/swift-for-loop-with-index/)
  {% endtab %}

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

* [for...in](/ios/swift/flow/loop/for...in.md)
* while 🚧
* repeat...while 🚧
  {% endtab %}

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

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

{% tab title="⭐️ 重點" %}
{% hint style="info" %}
GRAMMAR OF A LOOP STATEMENT

* loop-statement → [for-in-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_for-in-statement)
* loop-statement → [while-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_while-statement)
* loop-statement → [repeat-while-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_repeat-while-statement)
  {% endhint %}
  {% endtab %}

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

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