<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>toyship</author_name>
  <author_url>https://blog.hatena.ne.jp/toyship/</author_url>
  <blog_title>Toyship.org</blog_title>
  <blog_url>https://www.toyship.org/</blog_url>
  <categories>
  </categories>
  <description>Closureを使っていたら、ちょっと予想外の動作になってしまっていました。 超・基本的なことですが、動作確認したのでメモ。 closureの循環参照と weak self weak self をなぜ使うかというと、循環参照によるメモリーリークを避けるためですよね。 closureを保持するクラスを作って見てみましょう。 下の Personクラスは、生成・消滅した時がわかりやすいように init と deinit にログをいれておきます。 そシンプルに Hello, I am [name]! と表示してくれる normalHello というメソッドを作り、 keepAndDo メソッドで、cl…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.toyship.org%2F2018%2F12%2F12%2F070158&quot; title=&quot;わけあって weak self - Toyship.org&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>2018-12-12 07:01:58</published>
  <title>わけあって weak self</title>
  <type>rich</type>
  <url>https://www.toyship.org/2018/12/12/070158</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
