<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss/styles.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>肘子的 Swift 记事本 ｜ Fatbobman&apos;s Blog</title><description>中文首页｜肘子的 Swift 记事本｜Fatbobman&apos;s Blog，分享与 Swift、SwiftUI、Core Data、Swift Data 有关的内容，也会涉及开发工具、AI 等其他内容。全部文章均为原创，转载需联系本人</description><link>https://fatbobman.com/</link><language>zh</language><follow_challenge><feedId>55086689794490368</feedId><userId>60878761419746304</userId></follow_challenge><item><title>ContentBuilder 解析：SwiftUI 类型检查性能提升的秘密</title><link>https://fatbobman.com/zh/posts/contentbuilder-explained/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/contentbuilder-explained/</guid><description>在 WWDC 2026 中，苹果工程师介绍了 SwiftUI 的一个新特性——ContentBuilder。从使用方式看，它似乎只是一个覆盖范围更广的 ViewBuilder。苹果同时宣称，这项调整能够显著改善类型检查性能。本文将解析 ContentBuilder 的本质，探索性能提升背后的奥妙。</description><pubDate>Wed, 12 Aug 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;在 WWDC 2026 中，苹果工程师介绍了 SwiftUI 的一个新特性——ContentBuilder。从使用方式看，它似乎只是一个覆盖范围更广的 ViewBuilder。苹果同时宣称，这项调整能够显著改善类型检查性能。本文将解析 ContentBuilder 的本质，探索性能提升背后的奥妙。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/contentbuilder-explained/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>Apple Intelligence 已通过中国政府审核，即将在中国提供服务 - 肘子的 Swift 周报 #148</title><link>https://fatbobman.com/zh/weekly/issue-148/</link><guid isPermaLink="true">https://fatbobman.com/zh/weekly/issue-148/</guid><description>7 月，Apple Intelligence 已经出现在中国国家互联网信息办公室（CAC）公布的最新一批生成式 AI 服务备案名单中。而就在两天前，苹果又确认阿里巴巴 Qwen 将参与中国版 Apple Intelligence，并一度出现在苹果的官方文档中。</description><pubDate>Mon, 10 Aug 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;7 月，Apple Intelligence 已经出现在中国国家互联网信息办公室（CAC）公布的最新一批生成式 AI 服务备案名单中。而就在两天前，苹果又确认阿里巴巴 Qwen 将参与中国版 Apple Intelligence，并一度出现在苹果的官方文档中。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/weekly/issue-148/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>weekly</category><category>swiftui</category><author>Fatbobman</author></item><item><title>在 SwiftUI Text 中控制孤行：挖掘未公开的 avoidsOrphans</title><link>https://fatbobman.com/zh/posts/controlling-orphans-in-swiftui-text/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/controlling-orphans-in-swiftui-text/</guid><description>SwiftUI 的 Text 有一项默认行为：当段落末行只剩一个孤词或孤字时，它会主动把上一行的完整词组一并推到末行，避免“落单”。这份体贴多数时候是对的，但代价是上一行可能留下一大片空白——在窄容器或中英混排的场景中，反而破坏了段落的均衡。本文将挖掘 SwiftUI 中一个早已存在、却始终未曾公开的 API —— `avoidsOrphans`，让开发者重新拿回这项控制权。</description><pubDate>Thu, 06 Aug 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;SwiftUI 的 Text 有一项默认行为：当段落末行只剩一个孤词或孤字时，它会主动把上一行的完整词组一并推到末行，避免“落单”。这份体贴多数时候是对的，但代价是上一行可能留下一大片空白——在窄容器或中英混排的场景中，反而破坏了段落的均衡。本文将挖掘 SwiftUI 中一个早已存在、却始终未曾公开的 API —— `avoidsOrphans`，让开发者重新拿回这项控制权。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/controlling-orphans-in-swiftui-text/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>热茶还是冰咖啡 - 肘子的 Swift 周报 #147</title><link>https://fatbobman.com/zh/weekly/issue-147/</link><guid isPermaLink="true">https://fatbobman.com/zh/weekly/issue-147/</guid><description>最近我所在的城市，气温不断刷新历史纪录。从 7 月末开始，便陷入了持续十天以上、超过 30 摄氏度的高温酷暑。尽管从绝对数值上看并不算惊人，但配上超过 80% 的湿度，即便全天待在 25 度的空调房里，体内依然能攒出一股挥之不去的燥热。</description><pubDate>Mon, 03 Aug 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;最近我所在的城市，气温不断刷新历史纪录。从 7 月末开始，便陷入了持续十天以上、超过 30 摄氏度的高温酷暑。尽管从绝对数值上看并不算惊人，但配上超过 80% 的湿度，即便全天待在 25 度的空调房里，体内依然能攒出一股挥之不去的燥热。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/weekly/issue-147/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>weekly</category><category>swiftui</category><author>Fatbobman</author></item><item><title>Liquid Glass：UIKit 适配踩坑实录</title><link>https://fatbobman.com/zh/posts/liquid-glass-a-field-guide-to-uikit-compatibility-pitfalls/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/liquid-glass-a-field-guide-to-uikit-compatibility-pitfalls/</guid><description>尽管 Liquid Glass 已经推出两年，但它带来的兼容性问题并未完全消失。SLIT_STUDIO 的开发者 ⁠Megabits 结合真实项目，总结了 UIKit 在适配过程中的多个典型坑点及应对方法。</description><pubDate>Wed, 29 Jul 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;尽管 Liquid Glass 已经推出两年，但它带来的兼容性问题并未完全消失。SLIT_STUDIO 的开发者 ⁠Megabits 结合真实项目，总结了 UIKit 在适配过程中的多个典型坑点及应对方法。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/liquid-glass-a-field-guide-to-uikit-compatibility-pitfalls/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><category>guest post</category><author>Fatbobman</author></item><item><title>不是模型变慢了，是任务变大了 - 肘子的 Swift 周报 #146</title><link>https://fatbobman.com/zh/weekly/issue-146/</link><guid isPermaLink="true">https://fatbobman.com/zh/weekly/issue-146/</guid><description>最近，即便是一些我认为并不算复杂的工作，AI 交付结果也常常需要几分钟，甚至几十分钟。这让我产生了一种错觉：难道随着模型能力不断增强，速度只能越来越慢？</description><pubDate>Mon, 27 Jul 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;最近，即便是一些我认为并不算复杂的工作，AI 交付结果也常常需要几分钟，甚至几十分钟。这让我产生了一种错觉：难道随着模型能力不断增强，速度只能越来越慢？&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/weekly/issue-146/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>weekly</category><category>swiftui</category><author>Fatbobman</author></item><item><title>当灵感跑在了结果前面 - 肘子的 Swift 周报 #145</title><link>https://fatbobman.com/zh/weekly/issue-145/</link><guid isPermaLink="true">https://fatbobman.com/zh/weekly/issue-145/</guid><description>过去几个月，我一直在优化自己的 AI 工作流。尽管颇有进展，但在长任务中，始终缺乏一些可以量化的 benchmark 数据。得益于 AI 模型公司之间的竞争，不久前 OpenAI 解除了 5 小时的额度限制，这让我终于能够不间断地测试自己的一些想法，并比较不同方案在效果与性能上的差异。</description><pubDate>Mon, 20 Jul 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;过去几个月，我一直在优化自己的 AI 工作流。尽管颇有进展，但在长任务中，始终缺乏一些可以量化的 benchmark 数据。得益于 AI 模型公司之间的竞争，不久前 OpenAI 解除了 5 小时的额度限制，这让我终于能够不间断地测试自己的一些想法，并比较不同方案在效果与性能上的差异。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/weekly/issue-145/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>weekly</category><category>swiftui</category><author>Fatbobman</author></item><item><title>当每一次写入都有了新价格 - 肘子的 Swift 周报 #144</title><link>https://fatbobman.com/zh/weekly/issue-144/</link><guid isPermaLink="true">https://fatbobman.com/zh/weekly/issue-144/</guid><description>最近，OpenAI 的 Codex 被发现存在一个日志写入问题：程序会持续向本地数据库写入大量日志，导致文件不断膨胀，并产生远超正常水平的磁盘写入。类似的 Bug 过去并不少见。放在几年前，人们大概只是删除文件、重启应用，然后等待下一个版本修复。</description><pubDate>Mon, 13 Jul 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;最近，OpenAI 的 Codex 被发现存在一个日志写入问题：程序会持续向本地数据库写入大量日志，导致文件不断膨胀，并产生远超正常水平的磁盘写入。类似的 Bug 过去并不少见。放在几年前，人们大概只是删除文件、重启应用，然后等待下一个版本修复。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/weekly/issue-144/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>weekly</category><category>swiftui</category><author>Fatbobman</author></item><item><title>两个 SwiftUI 动画 Bug 排查小记</title><link>https://fatbobman.com/zh/posts/debugging-notes-on-two-swiftui-animation-bugs/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/debugging-notes-on-two-swiftui-animation-bugs/</guid><description>易用的动画一直是 SwiftUI 的主要特色之一。但声明式框架的特性是一把双刃剑：动画一旦出现异常，排查往往比命令式框架更棘手。本文记录了过去两周里，我在开发中遇到的两个与 SwiftUI 动画有关的 Bug，以及对应的排查过程。</description><pubDate>Wed, 01 Jul 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;易用的动画一直是 SwiftUI 的主要特色之一。但声明式框架的特性是一把双刃剑：动画一旦出现异常，排查往往比命令式框架更棘手。本文记录了过去两周里，我在开发中遇到的两个与 SwiftUI 动画有关的 Bug，以及对应的排查过程。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/debugging-notes-on-two-swiftui-animation-bugs/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>从 Size Class 到可用空间，horizontalSizeClass 还可靠吗？</title><link>https://fatbobman.com/zh/posts/from-size-class-to-available-space/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/from-size-class-to-available-space/</guid><description>从 WWDC 26 开始，iPhone 应用在 iPhone Mirroring 到 Mac 时，其窗口尺寸将支持自由调整。这次更新带来的影响远不止“iPhone 应用可以调整尺寸”这么简单。它正在改变许多开发者长期以来对布局系统的理解。这种变化究竟是一次突然出现的转向，还是 Apple 多年布局下的必然演进？本文将对此进行探讨。</description><pubDate>Wed, 17 Jun 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;从 WWDC 26 开始，iPhone 应用在 iPhone Mirroring 到 Mac 时，其窗口尺寸将支持自由调整。这次更新带来的影响远不止“iPhone 应用可以调整尺寸”这么简单。它正在改变许多开发者长期以来对布局系统的理解。这种变化究竟是一次突然出现的转向，还是 Apple 多年布局下的必然演进？本文将对此进行探讨。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/from-size-class-to-available-space/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>Core Data + Observation：从属性级响应到心智解放</title><link>https://fatbobman.com/zh/posts/core-data-observation-freer-mental-model/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/core-data-observation-freer-mental-model/</guid><description>Observation 框架的推出，让 SwiftUI 的状态响应从对象级进一步细化到属性级，显著缓解了许多由粗粒度观察带来的无效刷新问题。我近期在 Core Data Evolution 中探索并实现了对 Observation 的支持，赋予 NSManagedObject 属性级的精确观察能力。本文将围绕这一能力的动因、使用方式、实现思路、工程挑战以及开发过程中的一些取舍展开讨论。</description><pubDate>Wed, 03 Jun 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Observation 框架的推出，让 SwiftUI 的状态响应从对象级进一步细化到属性级，显著缓解了许多由粗粒度观察带来的无效刷新问题。我近期在 Core Data Evolution 中探索并实现了对 Observation 的支持，赋予 NSManagedObject 属性级的精确观察能力。本文将围绕这一能力的动因、使用方式、实现思路、工程挑战以及开发过程中的一些取舍展开讨论。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/core-data-observation-freer-mental-model/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>core data</category><category>concurrency</category><category>swiftui</category><author>Fatbobman</author></item><item><title>用自定义 Layout 化解 SwiftUI List 的行高与间距跳变</title><link>https://fatbobman.com/zh/posts/taming-row-height-and-spacing-jumps/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/taming-row-height-and-spacing-jumps/</guid><description>动画的声明式表达是 SwiftUI 的核心优势之一。但在某些场景里，结果并不总像我们期待的那样平滑。一个典型例子是：当 `List` 行内的内容高度发生动态变化——副标题从空变为非空、文本因更新而导致行数变化——系统自带的布局引擎往往无法给出连续的过渡动画。本文从这个现象出发，逐层拆解原因，给出一种完全基于 SwiftUI 原生能力的解决方案；也借这条路径回看 SwiftUI 在布局机制层面的几个关键约束。</description><pubDate>Wed, 27 May 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;动画的声明式表达是 SwiftUI 的核心优势之一。但在某些场景里，结果并不总像我们期待的那样平滑。一个典型例子是：当 `List` 行内的内容高度发生动态变化——副标题从空变为非空、文本因更新而导致行数变化——系统自带的布局引擎往往无法给出连续的过渡动画。本文从这个现象出发，逐层拆解原因，给出一种完全基于 SwiftUI 原生能力的解决方案；也借这条路径回看 SwiftUI 在布局机制层面的几个关键约束。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/taming-row-height-and-spacing-jumps/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>CDE：一次让 Core Data 更像现代 Swift 的尝试</title><link>https://fatbobman.com/zh/posts/cde-an-attempt-to-make-core-data-feel-more-like-modern-swift/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/cde-an-attempt-to-make-core-data-feel-more-like-modern-swift/</guid><description>在上一篇文章中，我聊了聊 Core Data 在当下项目中的一些现实处境。在本文中，我将介绍我的一个实验性项目 Core Data Evolution，探索能不能让 Core Data 在现代 Swift 项目中以一种更自然的方式继续存在下去？</description><pubDate>Wed, 18 Mar 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;在上一篇文章中，我聊了聊 Core Data 在当下项目中的一些现实处境。在本文中，我将介绍我的一个实验性项目 Core Data Evolution，探索能不能让 Core Data 在现代 Swift 项目中以一种更自然的方式继续存在下去？&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/cde-an-attempt-to-make-core-data-feel-more-like-modern-swift/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>core data</category><category>concurrency</category><author>Fatbobman</author></item><item><title>2026 年，为什么我仍在思考 Core Data</title><link>https://fatbobman.com/zh/posts/why-i-am-still-thinking-about-core-data-in-2026/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/why-i-am-still-thinking-about-core-data-in-2026/</guid><description>Core Data 在 2026 年仍有大量存量项目，但它与现代 Swift 的并发模型、类型安全和代码表达之间的错位越来越明显。本文梳理三个核心问题，并思考在不放弃 Core Data 的前提下实现现代化改造的可能。</description><pubDate>Wed, 11 Mar 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Core Data 在 2026 年仍有大量存量项目，但它与现代 Swift 的并发模型、类型安全和代码表达之间的错位越来越明显。本文梳理三个核心问题，并思考在不放弃 Core Data 的前提下实现现代化改造的可能。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/why-i-am-still-thinking-about-core-data-in-2026/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>core data</category><author>Fatbobman</author></item><item><title>跨域传递 NSManagedObjectContext 为什么在 Swift 6.2 中不再报错？真正的变化不在编译器</title><link>https://fatbobman.com/zh/posts/sendable-nsmanagedobjectcontext/</link><guid isPermaLink="true">https://fatbobman.com/zh/posts/sendable-nsmanagedobjectcontext/</guid><description>当同一段与并发有关的代码在 Xcode 16 中无法通过，却能在 Xcode 26 中顺利编译时，你第一时间会想到什么？我最初的判断是编译器进化了，但现实并没有这么简单。本文将记录我最近遇到的一次有意思的排查过程：从测试失败出发，一步步追到 Core Data 的 SDK interface，最终发现，问题的关键并不完全在 Swift 编译器本身，而在 NSManagedObjectContext 被导入 Swift 的方式已经发生了变化。</description><pubDate>Wed, 04 Mar 2026 14:00:00 GMT</pubDate><content:encoded>&lt;p&gt;当同一段与并发有关的代码在 Xcode 16 中无法通过，却能在 Xcode 26 中顺利编译时，你第一时间会想到什么？我最初的判断是编译器进化了，但现实并没有这么简单。本文将记录我最近遇到的一次有意思的排查过程：从测试失败出发，一步步追到 Core Data 的 SDK interface，最终发现，问题的关键并不完全在 Swift 编译器本身，而在 NSManagedObjectContext 被导入 Swift 的方式已经发生了变化。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;https://fatbobman.com/zh/posts/sendable-nsmanagedobjectcontext/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>concurrency</category><category>core data</category><author>Fatbobman</author></item><item><title>【小贴士】为什么父视图无法修改子视图的 @State</title><link>https://fatbobman.com/zh/snippet/why-child-state-won-not-update-from-parent-in-swiftui/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/why-child-state-won-not-update-from-parent-in-swiftui/</guid><description>在 init 中给 @State 赋值后，为什么父视图更新数据时子视图无反应？本文解析 SwiftUI 状态管理的生命周期机制与正确的数据传递方式。</description><pubDate>Thu, 18 Dec 2025 08:21:01 GMT</pubDate><content:encoded>&lt;p&gt;在 init 中给 @State 赋值后，为什么父视图更新数据时子视图无反应？本文解析 SwiftUI 状态管理的生命周期机制与正确的数据传递方式。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/why-child-state-won-not-update-from-parent-in-swiftui/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>swiftui</category><author>Fatbobman</author></item><item><title>【小贴士】Partytown 实战：修复 GTM 自定义事件与 dataLayer 失效问题</title><link>https://fatbobman.com/zh/snippet/how-to-forward-custom-tag-events-to-gtm-running-inside-partytown/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/how-to-forward-custom-tag-events-to-gtm-running-inside-partytown/</guid><description>使用 Partytown 优化性能后，GA4 和 GTM 事件无法上报？详解如何在 Astro 中配置 forward 属性，让主线程的 gtag 和 dataLayer.push 正常通讯。</description><pubDate>Mon, 08 Dec 2025 14:20:00 GMT</pubDate><content:encoded>&lt;p&gt;使用 Partytown 优化性能后，GA4 和 GTM 事件无法上报？详解如何在 Astro 中配置 forward 属性，让主线程的 gtag 和 dataLayer.push 正常通讯。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/how-to-forward-custom-tag-events-to-gtm-running-inside-partytown/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>web</category><category>performance</category><category>astro</category><author>Fatbobman</author></item><item><title>【小贴士】Swift 6 编译加速：启用 Swift-Syntax 预构建 (Prebuilts)</title><link>https://fatbobman.com/zh/snippet/speed-up-compilation-with-prebuilt-swift-syntax/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/speed-up-compilation-with-prebuilt-swift-syntax/</guid><description>Swift 宏编译太慢？在 Swift 6.1+ 中启用 Swift-Syntax 预构建 (Prebuilts)，一行命令显著减少 Xcode 构建时间，提升开发效率。</description><pubDate>Fri, 06 Jun 2025 00:20:00 GMT</pubDate><content:encoded>&lt;p&gt;Swift 宏编译太慢？在 Swift 6.1+ 中启用 Swift-Syntax 预构建 (Prebuilts)，一行命令显著减少 Xcode 构建时间，提升开发效率。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/speed-up-compilation-with-prebuilt-swift-syntax/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><author>Fatbobman</author></item><item><title>【小贴士】Swift 模块化：使用 package 关键字实现 Target 间安全共享</title><link>https://fatbobman.com/zh/snippet/controlling-access-within-a-swift-package/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/controlling-access-within-a-swift-package/</guid><description>如何在 Swift Package 的多个 Target 间共享代码却不暴露给外部？详解 package 访问修饰符，填补 internal 与 public 间的权限空白，提升模块封装性。</description><pubDate>Thu, 08 May 2025 14:21:01 GMT</pubDate><content:encoded>&lt;p&gt;如何在 Swift Package 的多个 Target 间共享代码却不暴露给外部？详解 package 访问修饰符，填补 internal 与 public 间的权限空白，提升模块封装性。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/controlling-access-within-a-swift-package/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><author>Fatbobman</author></item><item><title>【小贴士】Monorepo 实战：解决 VSCode/Cursor 中 SwiftLint 配置失效问题</title><link>https://fatbobman.com/zh/snippet/fixing-swiftlint-configuration-not-working-in-monorepo-projects/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/fixing-swiftlint-configuration-not-working-in-monorepo-projects/</guid><description>在 VSCode 或 Cursor 中开发 Swift Monorepo 项目时，SwiftLint 无法读取根目录配置？通过设置 configSearchPaths 和明确包含路径，轻松实现多包共享 Lint 规则。</description><pubDate>Thu, 24 Apr 2025 14:20:00 GMT</pubDate><content:encoded>&lt;p&gt;在 VSCode 或 Cursor 中开发 Swift Monorepo 项目时，SwiftLint 无法读取根目录配置？通过设置 configSearchPaths 和明确包含路径，轻松实现多包共享 Lint 规则。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/fixing-swiftlint-configuration-not-working-in-monorepo-projects/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>dev tools</category><author>Fatbobman</author></item><item><title>【小贴士】VSCode/Cursor 测试 Core Data：手动编译 xcdatamodeld 指南</title><link>https://fatbobman.com/zh/snippet/how-to-test-core-data-code-in-vscode-cursor/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/how-to-test-core-data-code-in-vscode-cursor/</guid><description>在 VSCode/Cursor 中运行 Core Data 单元测试报错？这是因为 xcdatamodeld 未被自动编译。学习配置 Xcode 工具链并使用 xcrun momc 手动生成 momd 文件，快速修复测试环境。</description><pubDate>Tue, 15 Apr 2025 14:21:01 GMT</pubDate><content:encoded>&lt;p&gt;在 VSCode/Cursor 中运行 Core Data 单元测试报错？这是因为 xcdatamodeld 未被自动编译。学习配置 Xcode 工具链并使用 xcrun momc 手动生成 momd 文件，快速修复测试环境。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/rss.xml&quot;&gt;&lt;b&gt;Subscribe English RSS&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&quot;&gt;&lt;a href=&quot;/zh/snippet/how-to-test-core-data-code-in-vscode-cursor/&quot;&gt;&lt;b&gt;阅读全文&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
                   &lt;/div&gt;
                   </content:encoded><category>computing</category><category>swift</category><category>learning</category><category>programming</category><category>swift-programming</category><category>ios-development</category><category>core data</category><author>Fatbobman</author></item></channel></rss>