# Publisher



{% tabs %}
{% tab title="💈範例" %}
* [timer](timer "mention") - use <mark style="color:purple;">**Timer**</mark>.[<mark style="color:orange;">**TimerPublisher**</mark>](https://developer.apple.com/documentation/foundation/timer/timerpublisher) ([`ConnectablePublisher`](https://developer.apple.com/documentation/combine/connectablepublisher))&#x20;
{% endtab %}

{% tab title="⭐️ 重點" %}
* One example of when you would want to use **type erasure** for a publisher (**AnyPublisher**) is when you want to use a pair of **public** and **private** properties, to allow the **owner** of those properties to **send values** on the **private publisher**, and let **outside callers** only **access** the **public publisher** for **subscribing** but **not** be able to **send values**.\
  👉  Combine - Asynchronous Programming with Swift (p.62)
{% endtab %}

{% tab title="📜 協定" %}
![Publisher 協定架構圖](https://1830103165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-JmwCZMKh_d7RfBaN%2F-MLNK0xV9cg-Vfjja3E-%2F-MLNKY3wgTE0uo1QQeTz%2FPublishers.png?alt=media\&token=fdd3f054-41b2-4fe0-ab4a-95dfefb03a2a)
{% endtab %}

{% tab title="📘 手冊" %}
* [Combine](https://developer.apple.com/documentation/combine)  ⟩  [Publisher](https://developer.apple.com/documentation/combine/publisher)
{% endtab %}

{% tab title="📗 參考" %}
*
{% endtab %}
{% endtabs %}
