<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>FromAtom</author_name>
  <author_url>https://blog.hatena.ne.jp/FromAtom/</author_url>
  <blog_title>文字っぽいの。</blog_title>
  <blog_url>https://fromatom.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>Swiftのguardは非常に便利で賢い仕組みですが、その性質上 Rubyの unless などと混同されてしまい、可読性が下がると誤解されがちです。 おそらく、guardを難しく感じている人はこのような読み方をしていると思います。 たしかにこれでは条件式を読解した上で、elseでその条件が否定するため難しく感じるでしょう。例えば、 guard !userClient.isLoggedIn else { // ログイン済み時の処理 return } // 未ログイン時の処理 といったコードの場合、isLoggedInの !isLoggedIn の else と読んでしまうため、「ログインして&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffromatom.hatenablog.com%2Fentry%2F2026%2F02%2F03%2F120349&quot; title=&quot;Swiftの`guard`を読みやすくするコツ - 文字っぽいの。&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/F/FromAtom/20260203/20260203112936.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-02-03 12:03:49</published>
  <title>Swiftの`guard`を読みやすくするコツ</title>
  <type>rich</type>
  <url>https://fromatom.hatenablog.com/entry/2026/02/03/120349</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
