# Attributes

{% hint style="info" %}
* <mark style="color:red;">**#available**</mark> - 用於 code block
* <mark style="color:red;">**@available**</mark> - 用於 method 或 class 前面
{% endhint %}

{% tabs %}
{% tab title="📘 手冊" %}
* Swift Language Reference ⟩ [Attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html)
  * [Declaration Attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID348)
  * [Type Attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID350)
  * [Switch Case Attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID604)
{% endtab %}

{% tab title="📗 參考" %}
* [x] Hacking with Swift - [Availability checking in Swift](https://www.hackingwithswift.com/new-syntax-swift-2-availability-checking)
* [ ] Better Programming - [10 Powerful @Attributes in Swift](https://betterprogramming.pub/10-powerful-attributes-in-swift-d4e4153a0001)
{% endtab %}

{% tab title="👥 相關" %}
* [directives](../appendix/xcode/directives "mention")
* [result-builders](attributes/result-builders "mention") (declaration attribute)
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="declaration attributes" %}
* #### available
* #### discardableResult
* #### dynamicCallable
* #### dynamicMemberLookup
* #### frozen
* ...
* #### propertyWrapper
* [**resultBuilder**](attributes/result-builders)
* ...
{% endtab %}

{% tab title="type attributes" %}
* #### [autoclosure](../features/autoclosure)
* #### escaping
* #### convention
{% endtab %}

{% tab title="switch case attributes" %}
* #### unknown
{% endtab %}
{% endtabs %}
