<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>第七篇 SwiftUI on 编程那些事儿</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/</link><description>Recent content in 第七篇 SwiftUI on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 19 Sep 2026 21:54:25 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/index.xml" rel="self" type="application/rss+xml"/><item><title>第40章 SwiftUI 的心智模型：视图是值，状态是源头</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-40-SwiftUI-Mental-Model/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-40-SwiftUI-Mental-Model/</guid><description>&lt;h1 id="第四十章swiftui-的心智模型视图是值状态是源头"&gt;第四十章：SwiftUI 的心智模型：视图是值，状态是源头&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;SwiftUI 让写界面变得太容易，容易到很多人跳过了&amp;quot;它到底怎么工作&amp;quot;这一步，然后在第一个真实需求上撞墙。这一章要建立的模型只有两句话：&lt;strong&gt;视图是描述，不是控件；状态是唯一的事实来源。&lt;/strong&gt; 把这两句话想透，后面七章都会轻松很多。&lt;/p&gt;</description></item><item><title>第41章 状态与数据流：谁拥有数据，谁只是借用</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-41-SwiftUI-State-and-Data-Flow/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-41-SwiftUI-State-and-Data-Flow/</guid><description>&lt;h1 id="第四十一章状态与数据流谁拥有数据谁只是借用"&gt;第四十一章：状态与数据流：谁拥有数据，谁只是借用&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;上一章说&amp;quot;状态是唯一的事实来源&amp;quot;。可一旦界面有五六层嵌套，这句口号立刻变成一个更具体的问题：&lt;strong&gt;这份状态放在哪一层？&lt;/strong&gt; 放高了，中间三层视图被迫当传话筒；放低了，兄弟视图读不到。这一章把 SwiftUI 里那四个属性包装器排成一张地图，从此不再靠猜。&lt;/p&gt;</description></item><item><title>第42章 布局与视图组合：一场父与子的谈判</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-42-SwiftUI-Layout-and-Composition/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-42-SwiftUI-Layout-and-Composition/</guid><description>&lt;h1 id="第四十二章布局与视图组合一场父与子的谈判"&gt;第四十二章：布局与视图组合：一场父与子的谈判&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;从 CSS 过来的人第一次写 SwiftUI 布局，通常会经历同一个瞬间：&lt;code&gt;frame(maxWidth: .infinity)&lt;/code&gt; 没反应，&lt;code&gt;Spacer()&lt;/code&gt; 一会儿有用一会儿没用，&lt;code&gt;.padding().background()&lt;/code&gt; 和 &lt;code&gt;.background().padding()&lt;/code&gt; 出来的效果完全不同。这些都不是 bug，而是因为你还没拿到 SwiftUI 布局的&lt;strong&gt;规则说明书&lt;/strong&gt;。这一章把它摊开。&lt;/p&gt;</description></item><item><title>第43章 列表、导航与弹窗：多页面应用怎么搭</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-43-SwiftUI-List-and-Navigation/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-43-SwiftUI-List-and-Navigation/</guid><description>&lt;h1 id="第四十三章列表导航与弹窗多页面应用怎么搭"&gt;第四十三章：列表、导航与弹窗：多页面应用怎么搭&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;一个能用的 App 基本就是&amp;quot;一列数据 + 一层层页面 + 偶尔蹦出来的弹窗&amp;quot;。SwiftUI 把这三件事的 API 都做得很短，短到你很容易忽略它们各自的坑。这一章只干一件事：把每个坑提前挖出来，让你第一次写列表就写对。&lt;/p&gt;</description></item><item><title>第44章 表单与用户输入：把数据请进门</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-44-SwiftUI-Forms-and-Input/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-44-SwiftUI-Forms-and-Input/</guid><description>&lt;h1 id="第四十四章表单与用户输入把数据请进门"&gt;第四十四章：表单与用户输入：把数据请进门&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;前面所有章节的数据都是&amp;quot;你自己造的&amp;quot;。真实的 App 里，绝大部分数据是用户敲进去的——而用户会空着不填、写错格式、在密码框里粘贴表情符号。这一章把输入控件、焦点和校验一次讲完，顺便给出一个能直接抄的表单模型写法。&lt;/p&gt;</description></item><item><title>第45章 动画与转场：让变化被看懂</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-45-SwiftUI-Animations/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-45-SwiftUI-Animations/</guid><description>&lt;h1 id="第四十五章动画与转场让变化被看懂"&gt;第四十五章：动画与转场：让变化被看懂&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;动画在 SwiftUI 里便宜得可疑：加个 &lt;code&gt;withAnimation { }&lt;/code&gt;，界面就从&amp;quot;啪&amp;quot;地跳变变成&amp;quot;滑&amp;quot;过去。便宜到很多人把它当装饰品到处撒。这一章先讲清动画的机制，再讲一条判断标准——&lt;strong&gt;这段动画有没有在解释&amp;quot;什么变了&amp;quot;？&lt;/strong&gt; 没有的话，它就是噪音。&lt;/p&gt;</description></item><item><title>第46章 异步、网络与生命周期：数据从哪来</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-46-SwiftUI-Async-and-Networking/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-46-SwiftUI-Async-and-Networking/</guid><description>&lt;h1 id="第四十六章异步网络与生命周期数据从哪来"&gt;第四十六章：异步、网络与生命周期：数据从哪来&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;真实的应用里，界面上大部分数据都不是&amp;quot;你造的&amp;quot;，而是&amp;quot;你去要来的&amp;quot;。要数据这件事有三个绕不开的性质：&lt;strong&gt;会慢、会失败、可能在你不要它的时候还在跑。&lt;/strong&gt; 这一章就围绕这三点，把 SwiftUI 里处理异步数据的标准做法立起来。&lt;/p&gt;</description></item><item><title>第47章 预览、测试、可访问性与发布</title><link>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-47-SwiftUI-Previews-Testing-and-Accessibility/</link><pubDate>Mon, 14 Sep 2026 22:30:00 +0800</pubDate><guid>https://before80.github.io/prgms/Swift/basic/Part-7-SwiftUI/Chapter-47-SwiftUI-Previews-Testing-and-Accessibility/</guid><description>&lt;h1 id="第四十七章预览测试可访问性与发布"&gt;第四十七章：预览、测试、可访问性与发布&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;前面八章教你&amp;quot;把界面写出来&amp;quot;。这一章解决最后那段最容易偷懒的路：&lt;strong&gt;写完到交付之间。&lt;/strong&gt; 预览让你不用每次跑起来才能看一眼；测试把&amp;quot;我点一遍好像没问题&amp;quot;变成可重复的证据；可访问性决定你的界面能被多少人用；发布清单决定它能不能顺利进商店。四件事都不难，只是不做就会一直疼。&lt;/p&gt;</description></item></channel></rss>