<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rasukarusan</author_name>
  <author_url>https://blog.hatena.ne.jp/rasukarusan/</author_url>
  <blog_title>ハイパーマッスルエンジニア</blog_title>
  <blog_url>https://www.rasukarusan.com/</blog_url>
  <categories>
    <anon>Swift</anon>
  </categories>
  <description>設置したUIButtonを親Viewの外に配置してしまうとタップが反応しない。 よくあるのは✗ボタンが右上に半分はみ出しているようなカスタムViewを作ったりするとき。 親Viewからはみ出して設置するタイプのボタン この状態だとタップが反応するのは親Viewにかぶっている部分のみになる。 親Viewからはみ出している領域は反応しない これはボタンの反応領域を広げてあげると解決できる。 ボタンの反応領域を広げる カスタムView内で下記を定義してあげればOK。 override func hitTest(_ point: CGPoint, with event: UIEvent?) -&gt; UI…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.rasukarusan.com%2Fentry%2F2020%2F05%2F30%2F172227&quot; title=&quot;【Swift】親Viewの領域外に設置したボタンを反応させる - ハイパーマッスルエンジニア&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>https://cdn-ak.f.st-hatena.com/images/fotolife/r/rasukarusan/20200530/20200530170230.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-05-30 17:22:27</published>
  <title>【Swift】親Viewの領域外に設置したボタンを反応させる</title>
  <type>rich</type>
  <url>https://www.rasukarusan.com/entry/2020/05/30/172227</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
