*https://developer.apple.com/documentation/xcode/adding_capabilities_to_your_app
[[File:swift_macos_net_error.png|600px]]
===UI===
----
====バックグラウンドからUIを操作する====
----
*observableobj が、ObservableObject の派生クラス
*contentフィールドに、@Published アノテーション
*Viewで、@ObservedObjectを付与しインスタンスを生成
*上記で、バックグラウンドから、observableobj.contentを操作すると、UIはメインスレッドから触るように怒られる。
<blockquote>Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.</blockquote>
<pre>
DispatchQueue.main.sync {
observableobj.content = text
}
</pre>