<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nekokichi_yos2</author_name>
  <author_url>https://blog.hatena.ne.jp/nekokichi_yos2/</author_url>
  <blog_title>ねこきちのプログラミング墓地</blog_title>
  <blog_url>https://nekokichi2yos2.hatenablog.com/</blog_url>
  <categories>
    <anon>Swift・Xcode</anon>
    <anon>プログラミング</anon>
  </categories>
  <description>どうも、ねこきち（@nekokichi1_yos2）です。 Swiftには、コールバック、が存在します。 （例：handler, completion） メリットは、 まとまった処理をブロックで持つ コールバック元の処理が完了後に実行される 非同期処理を順番に処理できる の特性を持っていることです。 今回は、コールバックを変数や関数の形で作る方法、を備忘録として書きます。 解説 変数で定義 関数で定義 ソースコード 参考 解説 変数で定義 let presentHandler:() -&gt; Void = { print(&quot;present&quot;) } let handler2 = { (value1:…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnekokichi2yos2.hatenablog.com%2Fentry%2F2020%2F08%2F25%2F210447&quot; title=&quot;【Swift】handlerとcompletionを変数/関数で作る - ねこきちのプログラミング墓地&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-08-25 21:04:47</published>
  <title>【Swift】handlerとcompletionを変数/関数で作る</title>
  <type>rich</type>
  <url>https://nekokichi2yos2.hatenablog.com/entry/2020/08/25/210447</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
