# custom result-builder attributes

[Swift](https://lochiwei.gitbook.io/ios/swift) ⟩ [Attributes](https://lochiwei.gitbook.io/ios/swift/attributes) ⟩ [Result Builders](https://lochiwei.gitbook.io/ios/swift/attributes/result-builders) ⟩

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="info" %}
Creating a <mark style="color:purple;">**result builder type**</mark> creates a <mark style="color:red;">**custom attribute**</mark> with the **same name**.
{% endhint %}

{% hint style="info" %} <mark style="color:red;">**custom attribute**</mark> can be applied on:

* <mark style="color:green;">**function**</mark>**&#x20;**<mark style="color:orange;">**declaration**</mark>:&#x20;
* <mark style="color:green;">**variable**</mark>/<mark style="color:green;">**subscript**</mark> <mark style="color:orange;">**declaration**</mark> that **includes** a <mark style="color:red;">**getter**</mark>:&#x20;
* <mark style="color:green;">**closure parameter**</mark> in a <mark style="color:orange;">**function declaration**</mark>:&#x20;

the **result builder** builds the **body** of the **function**/**getter**/**closure**.
{% endhint %}

{% hint style="info" %}

* Applying a **result builder attribute** <mark style="color:red;">**doesn’t**</mark> impact <mark style="color:purple;">**ABI**</mark> compatibility.&#x20;
* Applying a **result builder attribute** to a <mark style="color:orange;">**parameter**</mark> <mark style="color:red;">**does make**</mark> that <mark style="color:orange;">**attribute**</mark> <mark style="color:red;">**part of the function’s interface**</mark>, which can effect source compatibility.
  {% endhint %}
  {% endtab %}

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

* Swift Reference ⟩ Attributes ⟩ [Declaration Attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID348) ⟩ <mark style="color:red;">**resultBuilder**</mark> ⭐️
  {% endtab %}
  {% endtabs %}
