<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tokizuoh</author_name>
  <author_url>https://blog.hatena.ne.jp/tokizuoh/</author_url>
  <blog_title>カルボナーラ街道</blog_title>
  <blog_url>https://tokizuoh.hatenablog.com/</blog_url>
  <categories>
    <anon>SwiftUI</anon>
  </categories>
  <description>開発環境 TL;DR モチベーション SwiftUIのViewの拡張メソッドとしてのif-else 公式推奨のやり方 なぜ分岐をさせることが良くないのか おわりに 参考 開発環境 $ Xcode 14.3 Build version 14E222b TL;DR SwiftUIにおける条件分岐の注意点として、以下のことが言えそう。 分岐をするとViewのidentityは別物になる identityが異なるため分岐間で状態は引き継がれない 分岐が切り替わるごとにViewは初期化されるため、パフォーマンスの低下を引き起こす可能性がある モチベーション インターネットを見ていたらSwiftUIのVi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftokizuoh.hatenablog.com%2Fentry%2F2023%2F05%2F01%2F155638&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/t/tokizuoh/20230501/20230501151207.gif</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-05-01 15:56:38</published>
  <title>SwiftUIにおける条件分岐の注意点</title>
  <type>rich</type>
  <url>https://tokizuoh.hatenablog.com/entry/2023/05/01/155638</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
