<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bambookun</author_name>
  <author_url>https://blog.hatena.ne.jp/bambookun/</author_url>
  <blog_title>yujiro's blog</blog_title>
  <blog_url>https://bamboo-yujiro.hatenablog.com/</blog_url>
  <categories>
    <anon>Swift</anon>
    <anon>UnitTest</anon>
    <anon>単体テスト</anon>
    <anon>ユニットテスト</anon>
    <anon>Runtime</anon>
  </categories>
  <description>小ネタです。 ユニットテストを書いているとき、テスト対象のprivate なインスタンス変数を書き換えたいと思うことがあります。 標準のリフレクションだと結構面倒くさいことになります。 詳しくは、https://stackoverflow.com/questions/31589405/using-reflection-to-set-object-properties-without-using-setvalue-forkey をご参照ください。 上記のStackoverflow でも紹介されていますが、Runtime というライブラリを使うと簡単になるみたいです。 class Hoge { p…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbamboo-yujiro.hatenablog.com%2Fentry%2F2019%2F11%2F11%2F215536&quot; title=&quot;Swift でprivate なプロパティを書き換える - yujiro&amp;#39;s blog&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>2019-11-11 21:55:36</published>
  <title>Swift でprivate なプロパティを書き換える</title>
  <type>rich</type>
  <url>https://bamboo-yujiro.hatenablog.com/entry/2019/11/11/215536</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
