<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yunagi_n</author_name>
  <author_url>https://blog.hatena.ne.jp/yunagi_n/</author_url>
  <blog_title>なつねこメモ</blog_title>
  <blog_url>https://tech.natsuneko.blog/</blog_url>
  <categories>
    <anon>Swift</anon>
    <anon>SwiftUI</anon>
    <anon>UIKit</anon>
  </categories>
  <description>SwiftUI を使って Twitter や Instagram のようなアプリを作っていると、 だいたい一度はこんな UI を作りたくなります。 全体はタイムライン形式で縦スクロール 各投稿には複数枚の写真があって、横にスワイプすると切り替わる よくある UI ですね。 ただ、これを SwiftUI だけで自然に実装しようとすると、単純な実装だと難しかったです。 問題になるのは「斜めのドラッグ」で、例えば、次のような挙動をさせたいケースです。 上方向へのスクロールと見なせる場合はタイムラインスクロールを、水平方向へのスクロールはスワイプとして扱いたい ユーザーが完全に横にスワイプしているなら…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.natsuneko.blog%2Fentry%2F2026%2F01%2F04%2F164454&quot; title=&quot;斜めドラッグをどう扱う？SwiftUI で自然なタイムラインを作る - なつねこメモ&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/y/yunagi_n/20251228/20251228135652.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-01-04 16:44:54</published>
  <title>斜めドラッグをどう扱う？SwiftUI で自然なタイムラインを作る</title>
  <type>rich</type>
  <url>https://tech.natsuneko.blog/entry/2026/01/04/164454</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
