<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rils_k</author_name>
  <author_url>https://blog.hatena.ne.jp/rils_k/</author_url>
  <blog_title>まだどこにもないアプリを作る</blog_title>
  <blog_url>https://rils-k.hatenablog.com/</blog_url>
  <categories>
    <anon>SwiftUI</anon>
    <anon>Xcode</anon>
  </categories>
  <description>onChange()を使えばできるようです。 最初に@Stateで変数を定義しておいて、 その値が変わるごとに呼ばれるといった感じです。 import SwiftUI struct SwiftUIView: View { @State private var task = &quot;&quot; var body: some View { Form{ Section(){ TextField(&quot;タスクを入力&quot;,text:$task).onChange(of: task) { value in print(&quot;TextField - onChange&quot;) //テキスト保存などの処理 } } Section (){ …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frils-k.hatenablog.com%2Fentry%2F2022%2F02%2F07%2F044619&quot; title=&quot;【SwiftUI】TextfieldやText Editorで文字が入力されるごとに検知する方法。 - まだどこにもないアプリを作る&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/rils_k/20220207/20220207044329.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-02-07 04:46:19</published>
  <title>【SwiftUI】TextfieldやText Editorで文字が入力されるごとに検知する方法。</title>
  <type>rich</type>
  <url>https://rils-k.hatenablog.com/entry/2022/02/07/044619</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
