<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inon29</author_name>
  <author_url>https://blog.hatena.ne.jp/inon29/</author_url>
  <blog_title>It’s now or never</blog_title>
  <blog_url>https://inon29.hateblo.jp/</blog_url>
  <categories>
    <anon>Swift</anon>
    <anon>SwiftUI</anon>
    <anon>ViewModifier</anon>
    <anon>iOS</anon>
  </categories>
  <description>概要 SwiftUIを使ってアプリケーションを作成していると、Viewのコードが長くなり、Modifierの処理を共通化したいケースがでてくると思います。 そんな時にViewModifierを独自で定義して共通化するのも選択肢の１つです。 今回は、このような場合に独自でViewModifierを定義する方法について記述します。 環境 Swift: 5.2.2 Xcode: 11.4.1 独自のViewModifierの作り方 独自のViewModifierを作るには、 ViewModifier プロトコルに準拠した struct を作成します。 // NOTE: 文字色を赤にするカスタムVie…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finon29.hateblo.jp%2Fentry%2F2020%2F04%2F18%2F120616&quot; title=&quot;【SwiftUI】独自のViewModifierを定義する方法(ViewModifierプロトコル、View extension) - It’s now or never&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>2020-04-18 12:06:16</published>
  <title>【SwiftUI】独自のViewModifierを定義する方法(ViewModifierプロトコル、View extension)</title>
  <type>rich</type>
  <url>https://inon29.hateblo.jp/entry/2020/04/18/120616</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
