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

# local scope

[Swift](/ios/swift.md) ⟩ [scope](/ios/swift/scope.md) ⟩ global&#x20;

{% hint style="success" %}
A <mark style="color:purple;">local scope</mark> is formed at <mark style="color:yellow;">each new level of code orgazination</mark> below the [global scope](/ios/swift/scope/global.md). For example, a new [type](/ios/swift/type.md)╱[function](/ios/swift/type/category/basic/func.md)╱<mark style="color:orange;">code block</mark> forms a new <mark style="color:purple;">local scope</mark>.&#x20;

Based on where a symbol is declared, it's only accessible from code that is at the <mark style="color:yellow;">same</mark> or a <mark style="color:yellow;">lower level</mark> of [scope](/ios/swift/scope.md).
{% endhint %}

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

* [global scope](/ios/swift/scope/global.md)
  {% endtab %}
  {% endtabs %}
