<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2 应用结构 on 编程那些事儿</title><link>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/</link><description>Recent content in 2 应用结构 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/appstructure/index.xml" rel="self" type="application/rss+xml"/><item><title>4 沉浸式空间</title><link>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/4-ImmersiveSpaces/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/4-ImmersiveSpaces/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/immersive-spaces"&gt;https://developer.apple.com/documentation/swiftui/immersive-spaces&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="4-沉浸式空间"&gt;4 沉浸式空间&lt;/h1&gt;
&lt;p&gt;在人的周围环境中显示无边界的沉浸内容。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;在 visionOS 中使用沉浸式空间，可以在任何容器之外呈现 SwiftUI 视图。你可以在空间中放入任何视图，不过通常会使用 &lt;a href="https://developer.apple.com/documentation/realitykit/realityview"&gt;RealityView&lt;/a&gt; 来呈现 RealityKit 内容。&lt;/p&gt;</description></item><item><title>7 模态呈现</title><link>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/7-ModalPresentations/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/7-ModalPresentations/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/modal-presentations"&gt;https://developer.apple.com/documentation/swiftui/modal-presentations&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="7-模态呈现"&gt;7 模态呈现&lt;/h1&gt;
&lt;p&gt;在单独的视图中呈现内容，提供聚焦的交互。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;为了聚焦于一个重要的、范围有限的任务，你会显示一种模态呈现，例如提醒框、弹出视图（popover）、表单（sheet）或确认对话框。&lt;/p&gt;</description></item><item><title>8 工具栏</title><link>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/8-Toolbars/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/8-Toolbars/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/toolbars"&gt;https://developer.apple.com/documentation/swiftui/toolbars&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="8-工具栏"&gt;8 工具栏&lt;/h1&gt;
&lt;p&gt;为常用命令和控件提供即时访问入口。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;依据平台和上下文的不同，系统可能把工具栏放在应用内容的上方或下方。&lt;/p&gt;
&lt;p&gt;
 
 
 
 
 
 
 
 
 
 
 &lt;img src="https://before80.github.io/prgms/Swift/SwiftUI/appstructure/images/toolbars-hero@2x.png"
 alt="" data-cur-dir="Swift/SwiftUI/appstructure" data-rg="/images/toolbars-hero@2x.png" data-rg1="images/toolbars-hero@2x.png" data-rel="/prgms/images/toolbars-hero@2x.png" data-c4my="/prgms"
 
 /&gt;
 
 
&lt;/p&gt;
&lt;p&gt;通过把 &lt;a href="https://developer.apple.com/documentation/swiftui/view/toolbar(content:)"&gt;toolbar(content:)&lt;/a&gt; 视图修饰符应用到应用中的某个视图上，为工具栏添加条目。你也可以用视图修饰符配置工具栏，例如用 &lt;a href="https://developer.apple.com/documentation/swiftui/view/toolbar(_:for:)"&gt;toolbar(_:for:)&lt;/a&gt; 修饰符设置工具栏的可见性。&lt;/p&gt;</description></item><item><title>10 应用扩展</title><link>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/10-AppExtensions/</link><pubDate>Sat, 12 Sep 2026 12:47:47 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/SwiftUI/appstructure/10-AppExtensions/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://developer.apple.com/documentation/swiftui/app-extensions"&gt;https://developer.apple.com/documentation/swiftui/app-extensions&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="10-应用扩展"&gt;10 应用扩展&lt;/h1&gt;
&lt;p&gt;把应用的基本功能扩展到系统的其他部分，例如通过添加小组件。&lt;/p&gt;
&lt;h2 id="Overview"&gt;概述&lt;/h2&gt;
&lt;p&gt;把 SwiftUI 与 &lt;a href="https://developer.apple.com/documentation/widgetkit"&gt;WidgetKit&lt;/a&gt; 结合使用，为你的应用添加小组件。&lt;/p&gt;
&lt;p&gt;
 
 
 
 
 
 
 
 
 
 
 &lt;img src="https://before80.github.io/prgms/Swift/SwiftUI/appstructure/images/app-extensions-hero@2x.png"
 alt="" data-cur-dir="Swift/SwiftUI/appstructure" data-rg="/images/app-extensions-hero@2x.png" data-rg1="images/app-extensions-hero@2x.png" data-rel="/prgms/images/app-extensions-hero@2x.png" data-c4my="/prgms"
 
 /&gt;
 
 
&lt;/p&gt;
&lt;p&gt;小组件让你可以快速访问应用中的相关内容。定义一个遵循 &lt;a href="https://developer.apple.com/documentation/swiftui/widget"&gt;Widget&lt;/a&gt; 协议的结构体，并为该小组件声明视图层级。小组件内部的视图和其他 SwiftUI 视图一样，使用视图修饰符来配置，只是还会用到少数小组件专用的修饰符。&lt;/p&gt;</description></item></channel></rss>