<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>6 事件处理 on 编程那些事儿</title><link>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/</link><description>Recent content in 6 事件处理 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sun, 13 Sep 2026 18:20:56 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/index.xml" rel="self" type="application/rss+xml"/><item><title>2 输入事件</title><link>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/2-InputEvents/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/2-InputEvents/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/input-events"&gt;https://developer.apple.com/documentation/swiftui/input-events&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="2-输入事件"&gt;2 输入事件&lt;/h1&gt;
&lt;p&gt;响应来自键盘、Touch Bar 等硬件设备的输入。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;SwiftUI 提供了一些视图修饰符，让你的应用可以监听并响应各种用户输入。例如，你可以创建键盘快捷方式、响应表单提交，或者获取来自 Apple Watch 数码表冠的输入。&lt;/p&gt;</description></item><item><title>3 剪贴板</title><link>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/3-Clipboard/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/3-Clipboard/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/clipboard"&gt;https://developer.apple.com/documentation/swiftui/clipboard&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="3-剪贴板"&gt;3 剪贴板&lt;/h1&gt;
&lt;p&gt;让大家能够通过执行“拷贝”和“粘贴”命令来移动或复制项目。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;当人们执行标准的“拷贝”和“剪切”命令时，他们期望把项目移动到系统剪贴板，之后可以再把项目粘贴到同一应用中的其他位置，或粘贴到另一个应用中。只要添加用于指明如何响应这些标准命令的视图修饰符，你的应用就能参与这项活动。&lt;/p&gt;</description></item><item><title>6 系统事件</title><link>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/6-SystemEvents/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/eventhandling/6-SystemEvents/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/system-events"&gt;https://developer.apple.com/documentation/swiftui/system-events&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="6-系统事件"&gt;6 系统事件&lt;/h1&gt;
&lt;p&gt;响应打开 URL 等系统事件。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;指定视图和场景修饰符，可以指明应用如何响应某些系统事件。例如，你可以用 &lt;a href="https://developer.apple.com/documentation/swiftui/view/onopenurl(perform:)"&gt;onOpenURL(perform:)&lt;/a&gt; 视图修饰符定义一个动作，当应用收到通用链接时执行；也可以用 &lt;a href="https://developer.apple.com/documentation/swiftui/scene/backgroundtask(_:action:)"&gt;backgroundTask(_:action:)&lt;/a&gt; 场景修饰符指定一个异步任务，以响应后台任务事件（例如后台 URL 会话完成）。&lt;/p&gt;</description></item></channel></rss>