<?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、SwiftUI 问答与小贴士</title><description>有关 Swift、SwiftUI、Core Data 和 SwiftData 的小贴士与问答 ｜ 肘子的 Swift 记事本</description><link>https://fatbobman.com/zh/snippet/</link><language>zh</language><follow_challenge><feedId>102701100187614208</feedId><userId>60878761419746304</userId></follow_challenge><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/en/snippet/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/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>如何在 SwiftData 中批量删除数据</title><link>https://fatbobman.com/zh/snippet/how-to-batch-delete-data-in-swiftdata/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/how-to-batch-delete-data-in-swiftdata/</guid><description>逐个删除数据会导致 UI 卡顿？本文介绍如何使用 SwiftData 的 delete(model:where:) 方法，通过一行代码绕过 Context 实现高性能的批量数据清理与条件删除。</description><pubDate>Wed, 17 Dec 2025 21:33:00 GMT</pubDate><content:encoded>&lt;p&gt;逐个删除数据会导致 UI 卡顿？本文介绍如何使用 SwiftData 的 delete(model:where:) 方法，通过一行代码绕过 Context 实现高性能的批量数据清理与条件删除。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/how-to-batch-delete-data-in-swiftdata/&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>swiftdata</category><author>Fatbobman</author></item><item><title>Core Data/SwiftData 实体继承会导致应用性能下降吗？</title><link>https://fatbobman.com/zh/snippet/is-entity-inheritance-slowing-down-your-swiftdata-coredata-app/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/is-entity-inheritance-slowing-down-your-swiftdata-coredata-app/</guid><description>Core Data 与 SwiftData 采用单表继承（Single Table Inheritance）存储数据。本文解析其底层 SQLite 实现机制，探讨字段冗余对性能的影响，并提供数据模型设计建议。</description><pubDate>Sat, 13 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Core Data 与 SwiftData 采用单表继承（Single Table Inheritance）存储数据。本文解析其底层 SQLite 实现机制，探讨字段冗余对性能的影响，并提供数据模型设计建议。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/is-entity-inheritance-slowing-down-your-swiftdata-coredata-app/&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>swiftdata</category><author>Fatbobman</author></item><item><title>Swift 格式化指南：如何区分显示身高与道路距离</title><link>https://fatbobman.com/zh/snippet/formatting-person-height-vs-road-distance-in-swift/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/formatting-person-height-vs-road-distance-in-swift/</guid><description>告别繁琐的手动单位换算！Swift MeasurementFormatStyle 的 usage 参数，可根据语境（如身高、道路距离等）自动智能格式化度量值——比如身高自动显示“5 ft 11 in”，物体长度或道路则显示“5.9 ft”等最符合本地习惯的单位。让你的 iOS/SwiftUI 应用实现国际化格式与本地化用户体验的有机统一。</description><pubDate>Fri, 12 Dec 2025 14:20:00 GMT</pubDate><content:encoded>&lt;p&gt;告别繁琐的手动单位换算！Swift MeasurementFormatStyle 的 usage 参数，可根据语境（如身高、道路距离等）自动智能格式化度量值——比如身高自动显示“5 ft 11 in”，物体长度或道路则显示“5.9 ft”等最符合本地习惯的单位。让你的 iOS/SwiftUI 应用实现国际化格式与本地化用户体验的有机统一。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/formatting-person-height-vs-road-distance-in-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><author>Fatbobman</author></item><item><title>Swift 6 线程安全：用 Mutex 替代 @unchecked Sendable</title><link>https://fatbobman.com/zh/snippet/replace-unchecked-sendable-with-mutex/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/replace-unchecked-sendable-with-mutex/</guid><description>不想把代码全改成 Actor？了解如何使用 Swift 6 的 Mutex 构建真正 Sendable 的引用类型，告别 @unchecked Sendable 的安全隐患。</description><pubDate>Fri, 12 Dec 2025 09:15:00 GMT</pubDate><content:encoded>&lt;p&gt;不想把代码全改成 Actor？了解如何使用 Swift 6 的 Mutex 构建真正 Sendable 的引用类型，告别 @unchecked Sendable 的安全隐患。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/replace-unchecked-sendable-with-mutex/&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><author>Fatbobman</author></item><item><title>CloudKit 调试技巧：如何查看测试账户的云端数据</title><link>https://fatbobman.com/zh/snippet/act-as-icloud-account/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/act-as-icloud-account/</guid><description>测试 CloudKit 同步时看不到数据？详解如何使用 CloudKit 控制台的 &apos;Act As iCloud Account&apos; 功能，查看和调试非开发账户（测试号）的私有数据库。</description><pubDate>Thu, 11 Dec 2025 21:30:00 GMT</pubDate><content:encoded>&lt;p&gt;测试 CloudKit 同步时看不到数据？详解如何使用 CloudKit 控制台的 &apos;Act As iCloud Account&apos; 功能，查看和调试非开发账户（测试号）的私有数据库。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/act-as-icloud-account/&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>cloudkit</category><author>Fatbobman</author></item><item><title>为什么 CloudKit 控制台看不到 Core Data/SwiftData 的同步数据？</title><link>https://fatbobman.com/zh/snippet/show-records-in-cloudkit-dashboard/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/show-records-in-cloudkit-dashboard/</guid><description>Core Data 或 SwiftData 同步正常，但 CloudKit Dashboard 显示无记录？这是因为缺少索引。本文详解如何为 recordName 添加 queryable 索引以在控制台查看和调试数据。</description><pubDate>Thu, 11 Dec 2025 00:20:00 GMT</pubDate><content:encoded>&lt;p&gt;Core Data 或 SwiftData 同步正常，但 CloudKit Dashboard 显示无记录？这是因为缺少索引。本文详解如何为 recordName 添加 queryable 索引以在控制台查看和调试数据。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/show-records-in-cloudkit-dashboard/&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>cloudkit</category><category>core data</category><category>swiftdata</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/en/snippet/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/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/en/snippet/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/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/en/snippet/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/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/en/snippet/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/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/en/snippet/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/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><item><title>让 SwiftUI @AppStorage 支持数组、Date 与自定义类型</title><link>https://fatbobman.com/zh/snippet/extending-supported-data-types-for-appstorage/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/extending-supported-data-types-for-appstorage/</guid><description>SwiftUI 的 @AppStorage 默认仅支持基础类型。本文介绍如何利用 RawRepresentable 协议和 JSON 编解码，一行代码让 @AppStorage 支持 Date、Array 及自定义结构体的存储。</description><pubDate>Fri, 24 Jan 2025 00:20:00 GMT</pubDate><content:encoded>&lt;p&gt;SwiftUI 的 @AppStorage 默认仅支持基础类型。本文介绍如何利用 RawRepresentable 协议和 JSON 编解码，一行代码让 @AppStorage 支持 Date、Array 及自定义结构体的存储。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/extending-supported-data-types-for-appstorage/&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>修复 Algolia DocSearch 在 Safari 关闭后自动回到底部的 Bug</title><link>https://fatbobman.com/zh/snippet/fix-algolia-search-box-auto-scrolling-issue-in-safari/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/fix-algolia-search-box-auto-scrolling-issue-in-safari/</guid><description>Algolia 搜索框关闭后页面自动滚到底部？这是一个困扰 Safari 用户的常见 DocSearch Bug。只需一行 HTML 代码即可完美修复。</description><pubDate>Thu, 23 Jan 2025 16:20:00 GMT</pubDate><content:encoded>&lt;p&gt;Algolia 搜索框关闭后页面自动滚到底部？这是一个困扰 Safari 用户的常见 DocSearch Bug。只需一行 HTML 代码即可完美修复。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/fix-algolia-search-box-auto-scrolling-issue-in-safari/&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><author>Fatbobman</author></item><item><title>修复 macOS SwiftData/Core Data 同步失效：手动添加 CloudKit.framework</title><link>https://fatbobman.com/zh/snippet/fix-synchronization-issues-for-macos-apps-using-core-dataswiftdata/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/fix-synchronization-issues-for-macos-apps-using-core-dataswiftdata/</guid><description>macOS 应用在 TestFlight 中无法同步 SwiftData 或 Core Data？调试模式正常但发布后失效？详解如何通过添加 CloudKit.framework 解决此经典构建问题。</description><pubDate>Thu, 23 Jan 2025 00:20:00 GMT</pubDate><content:encoded>&lt;p&gt;macOS 应用在 TestFlight 中无法同步 SwiftData 或 Core Data？调试模式正常但发布后失效？详解如何通过添加 CloudKit.framework 解决此经典构建问题。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/fix-synchronization-issues-for-macos-apps-using-core-dataswiftdata/&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>swiftdata</category><category>core data</category><category>cloudkit</category><author>Fatbobman</author></item><item><title>SwiftUI 布局指南：4种方式动态获取视图尺寸</title><link>https://fatbobman.com/zh/snippet/how-to-obtain-view-dimensions-in-swiftui/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/how-to-obtain-view-dimensions-in-swiftui/</guid><description>还在滥用 GeometryReader？详解 SwiftUI 获取视图尺寸的 4 种方案。从 iOS 16 的 onGeometryChange 到 containerRelativeFrame，轻松实现高效的响应式布局。</description><pubDate>Mon, 13 Jan 2025 17:20:00 GMT</pubDate><content:encoded>&lt;p&gt;还在滥用 GeometryReader？详解 SwiftUI 获取视图尺寸的 4 种方案。从 iOS 16 的 onGeometryChange 到 containerRelativeFrame，轻松实现高效的响应式布局。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/how-to-obtain-view-dimensions-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>SwiftUI 禁用动画：无缝切换 Sheet 与 NavigationStack</title><link>https://fatbobman.com/zh/snippet/disable-transition-animations-for-sheet-and-navigationstack-in-swiftui/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/disable-transition-animations-for-sheet-and-navigationstack-in-swiftui/</guid><description>想在 Deep Link 或状态重置时跳过转场？通过自定义 Transaction 和 disablesAnimations，一行代码屏蔽 Sheet 与 NavigationStack 的默认动画，实现即时跳转。</description><pubDate>Sun, 12 Jan 2025 11:20:00 GMT</pubDate><content:encoded>&lt;p&gt;想在 Deep Link 或状态重置时跳过转场？通过自定义 Transaction 和 disablesAnimations，一行代码屏蔽 Sheet 与 NavigationStack 的默认动画，实现即时跳转。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/disable-transition-animations-for-sheet-and-navigationstack-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>SwiftUI 动画详解：隐式 vs 显式动画的区别与实战</title><link>https://fatbobman.com/zh/snippet/swiftui-implicit-vs-explicit-animations/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/swiftui-implicit-vs-explicit-animations/</guid><description>分不清 .animation 和 withAnimation？深入解析 SwiftUI 隐式与显式动画的核心差异、优先级规则及 Transaction 机制，助你精准控制 UI 状态变化。</description><pubDate>Sun, 12 Jan 2025 09:50:00 GMT</pubDate><content:encoded>&lt;p&gt;分不清 .animation 和 withAnimation？深入解析 SwiftUI 隐式与显式动画的核心差异、优先级规则及 Transaction 机制，助你精准控制 UI 状态变化。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/swiftui-implicit-vs-explicit-animations/&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>SwiftUI 手势状态管理：详解 @GestureState 与 @State 的中断处理</title><link>https://fatbobman.com/zh/snippet/differences-between-gesturestate-and-state-in-swiftui/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/differences-between-gesturestate-and-state-in-swiftui/</guid><description>为什么手势被打断会导致 UI 卡死？深入对比 @GestureState 与 @State 的核心差异，了解如何利用自动复位机制处理系统级中断，提升交互稳定性。</description><pubDate>Sun, 12 Jan 2025 08:21:01 GMT</pubDate><content:encoded>&lt;p&gt;为什么手势被打断会导致 UI 卡死？深入对比 @GestureState 与 @State 的核心差异，了解如何利用自动复位机制处理系统级中断，提升交互稳定性。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/differences-between-gesturestate-and-state-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>CloudKit 同步避坑指南：Core Data 与 SwiftData 模型设计规范</title><link>https://fatbobman.com/zh/snippet/rules-for-adapting-data-models-to-cloudkit/</link><guid isPermaLink="true">https://fatbobman.com/zh/snippet/rules-for-adapting-data-models-to-cloudkit/</guid><description>启用 CloudKit 同步前必读！了解数据模型的硬性限制：为何禁止唯一约束？为何关系必须可选？掌握“只增不减”的轻量迁移原则，避免同步失败。</description><pubDate>Sat, 11 Jan 2025 16:54:00 GMT</pubDate><content:encoded>&lt;p&gt;启用 CloudKit 同步前必读！了解数据模型的硬性限制：为何禁止唯一约束？为何关系必须可选？掌握“只增不减”的轻量迁移原则，避免同步失败。&lt;/p&gt;
                   &lt;div style=&quot;margin-top: 20px;&quot;&gt;
                   &lt;p&gt;&lt;a href=&quot;https://fatbobman.com/en/snippet/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/snippet/rules-for-adapting-data-models-to-cloudkit/&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>swiftdata</category><category>cloudkit</category><author>Fatbobman</author></item></channel></rss>