Fatbobman's Swift Weekly #123
Wishing Everyone a Happy Year of the Horse!
Wishing Everyone a Happy Year of the Horse!
This Chinese New Year ushers in the Bingwu Year (丙午) — a once‑in‑60‑years “Red Horse Year” (赤马年) .
In the traditional Chinese stem‑branch calendar, the Heavenly Stem Bing (丙) and the Earthly Branch Wu (午) both belong to the Fire element. This double‑fire combination creates an exceptionally rare “Fire Horse” pattern. Since fire is associated with the colour red, this Year of the Horse is also called the “Red Horse Year” (红马年) . This red horse embodies pure vitality and soaring spirits, symbolising a year full of boundless energy and enterprising drive.
At this once‑in‑60‑years auspicious moment, I wish all my readers: good health (CPU at full power), a soaring career (performance optimised), smooth sailing in everything (bug‑free runtime), and immediate success (compilation passed)! 🎉
Previous Issue|Newsletter Archive
📢 Sponsor Fatbobman’s Swift Weekly
Promote your product to Swift & iOS developers across:
- Blog: 50,000+ monthly visitors
- Newsletter: 4,000+ subscribers, 53% open rate
Perfect for developer tools, courses, and services.
Enjoyed this issue? Buy me a coffee ☕️
Recent Recommendations
Swift Concurrency from Zero to Hero | Reading List
Setting AI aside—since it still struggles to handle complex Swift 6 concurrency code at an expert level—even as tools rapidly evolve, you shouldn’t remain a passive observer. A systematic and comprehensive understanding of Swift Concurrency—its concepts, usage patterns, and historical evolution—is essential for building safer and more resilient applications from the ground up. In this article, Alex Ozun organizes a structured learning roadmap for Swift Concurrency, divided by difficulty levels. Each stage is accompanied by publicly available, free resources, with complexity gradually increasing. The goal is simple: complete the journey and move from Zero to Hero.
A Modern iOS Project Setup in 15 Steps
For many developers, starting a new project means repeating a series of tedious setup steps. In this thread, Ertem Biyik outlines a modern engineering baseline for iOS projects in 15 steps: using Tuist to manage dependencies and project generation, centralizing configuration through xcconfig, simplifying onboarding with a Makefile, and validating builds with GitHub Actions. He also recommends standardizing AI context with AGENTS.md and leveraging sosumi.ai for LLM-friendly Apple documentation.
Micelio: Growing Software Like Nature Grows Forests
As AI becomes deeply embedded in development workflows, many traditional tools are starting to show their limitations. Using the metaphor of a mycelium network, Pedro Piñera argues that Git’s model—capturing what changed but rarely preserving why it changed—may no longer be sufficient in an AI-first world. This article presents his systematic reflection on a “post-Git era” and introduces an experimental approach to agent-first collaboration. The accompanying open-source forge project, Micelio, centers around sessions as the core unit to capture context and reasoning, shifting code hosting from storing diffs to storing decisions. Though still early-stage, the problem framing and engineering direction are worth watching.
Copy-on-Write in Swift - How It Works and Why It Optimizes Memory
Copy-on-Write (COW) is a fundamental mechanism in Swift and a key reason value types can achieve strong semantics without sacrificing performance. Sagar Unagar explains how Swift balances value semantics and runtime efficiency through a “struct wrapper + reference storage” model: reads share storage, while writes trigger a real copy only when the reference is no longer unique, detected via isKnownUniquelyReferenced. The article also demonstrates how to implement COW in custom types.
Taking First Steps into Metal Shaders
For many SwiftUI developers, Metal can feel distant and complex. In this article, Letizia Granata walks through the basics of working with shaders—from understanding CPU/GPU responsibilities to adding a .metal file in Xcode and applying a simple shader effect in SwiftUI. Rather than diving into rendering pipelines or graphics theory, the focus is on getting something running, lowering the barrier to entry for experimentation.
Setting Up a Backend Server for Our Landmarks App
Landmarks is Apple’s classic SwiftUI tutorial app, but its reliance on local JSON data leaves a gap between example and real-world architecture. Kyle Browning builds a simple backend using Vapor to serve data via API, transforming the static demo into a client-server structure. The article covers model definition, routing, data responses, and integration with SwiftUI—less about complex business logic and more about extending a teaching example into something closer to production reality.
In the Background: Spotlight Indexing
After a system update, Macs often run hot and sluggish for a few days—commonly attributed to Spotlight reindexing. But how exactly does Spotlight scan files, decide when to rebuild its index, and manage system resources in the background? Howard Oakley analyzes logs and empirical data to explore Spotlight’s triggering mechanisms, process behavior, and impact on I/O and performance, offering a deeper technical look at macOS internals.
Tools
ScreenStateKit: A Better MVVM for the SwiftUI Concurrency Era
If you appreciate TCA’s unidirectional data flow and predictable state management but don’t want to fully refactor your existing MVVM architecture, ScreenStateKit may offer a pragmatic middle ground. Anthony Tran splits the traditional ViewModel into two clearly defined components: a @MainActor-isolated ScreenState that holds UI state, and a Swift actor-based ScreenActionStore that handles business logic and async tasks. All mutations flow through strongly typed Actions, bringing compile-time concurrency safety and TCA-like discipline to MVVM. Built-in loading/error handling, duplicate request prevention (ActionLocker), parent-child state propagation, and pagination support round out the design. Anthony also provides a detailed design article explaining the architecture and its rationale.
GitHub Directory Downloader
If you’ve ever cloned an entire repository just to download a single folder from GitHub, this tool is for you. Developed by Stewart Lynch, this native macOS app lets you paste any GitHub repository or directory URL (including tree/branch/path formats), automatically detect the default branch, recursively download the selected directory, and preserve its original structure.
SimTag: Branch Context for Your iOS Simulators
In parallel development workflows, it’s easy to lose track of which branch is running in which iOS Simulator. Developed by Aryaman Sharda, SimTag overlays a lightweight label on each Simulator window, showing the git branch and commit corresponding to the running build. For developers using worktrees, reviewing PRs, or collaborating with AI tools, it helps reduce cognitive friction and prevents debugging the wrong branch.
Thanks for reading Fatbobman’s Swift Weekly! This post is public so feel free to share it.
祝大家马年新春快乐!
今年的中国农历年是丙午年,是一个60年一遇的“赤马年”。
在干支纪年中,天干“丙”与地支“午”五行皆属火,双火叠加,形成了极为罕见的“火马”格局。因火色为赤,故此马年又称“红马年”。这匹“红马”承载着最纯粹的阳刚之气与蓬勃活力,预示着接下来的一年将充满奔放的能量与昂扬的进取心。
在这个 60 年一遇的吉庆节点,我在此祝各位读者新的一年:身体健康(CPU 满血),事业驰骋(性能优化),万事顺遂(无 Bug 运行),马到成功(编译通过)! 🎉
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
近期推荐
Swift 并发进阶阅读路线图 (Swift Concurrency from Zero to Hero | Reading List)
暂不说 AI 目前还很难像专家一样处理 Swift 6 并发相关的复杂代码,即便工具能力突飞猛进,作为使用者的你也不该只当旁观者:系统、全面地理解 Swift 并发的概念、用法与历史脉络,才能从源头构建更安全、更强健的应用。Alex Ozun 在本文中按难度划分关卡,整理了一份“从入门到进阶”的 Swift Concurrency 阅读路线图:每一关都配套了公开且免费的参考资料,难度也会逐级递增,希望你在完成这条主线之后,能从 Zero 走到 Hero。
15 步打造现代 iOS 项目 (A Modern iOS Project Setup in 15 Steps)
对于不少开发者而言,新项目的开始往往伴随着重复而琐碎的配置工作。Ertem Biyik 在这条串贴中用 15 个步骤梳理了一套现代 iOS 项目的工程化基线:以 Tuist 为核心管理依赖与生成,通过 xcconfig 统一环境配置与构建参数,借助 Makefile 简化初始化流程,并在 GitHub Actions 中完成 lint 与构建校验;同时,他还建议使用 AGENTS.md 统一 AI 上下文,并配合 sosumi.ai 获取更利于 LLM 阅读的 Apple 文档。
Micelio:后 Git 时代的代码托管工具 (Micelio: Growing Software Like Nature Grows Forests)
AI 深度参与开发流程后,许多传统工具开始显露出“水土不服”。Pedro Piñera 以“菌丝网络(mycelium)”为隐喻,指出随着 AI agent 参与开发的规模与频率不断提升,Git 这种只记录 what changed、却难以保留 why it changed 的历史模型,正在变得不够充分。本文是他对“后 Git 时代”的一次系统性思考,也是对“agent-first 协作方式”的公开实验。配套的开源 git forge Micelio 项目尝试以 session 为核心单元捕获上下文与推理,将代码托管的重心从“存 diff”转向“存决策”。项目仍处于早期阶段,但其问题意识与工程方向,都值得持续关注。
Swift 写时复制 (Copy-on-Write in Swift - How It Works and Why It Optimizes Memory)
写时复制(COW)是 Swift 的核心机制之一,也是值类型在保证语义一致性的同时获得良好性能的关键。Sagar Unagar 结合集合类型的内部实现,解释了 Swift 如何通过“结构体外壳 + 引用存储”的方式实现读共享、写分离:只有在发生写入且检测到非唯一引用时,才会借助 isKnownUniquelyReferenced 触发真正的拷贝。文章同时展示了自定义类型实现 COW 的基本模式。
Metal Shader 入门 (Taking First Steps into Metal Shaders)
对于大多数 SwiftUI 开发者而言,Metal 往往显得遥远而复杂。Letizia Granata 通过本文带你从 0 开始接触 Shader:从理解 GPU 与 CPU 的分工,到在 Xcode 中添加 .metal 文件,再到编写并在 SwiftUI 中应用一个最简单的 shader 效果。Letizia 没有深入渲染管线或图形学细节,而是聚焦“如何真正跑起来”,帮助读者跨过入门门槛。
为 Landmarks 构建 Vapor 后端 (Setting Up a Backend Server for Our Landmarks App)
Landmarks 是 Apple 在 SwiftUI 教程中提供的经典示例应用,但由于它使用本地 JSON 数据,与真实项目的客户端—服务器架构仍存在差距。Kyle Browning 使用 Vapor 为 Landmarks 构建了一个简单的后端服务,将静态示例升级为通过 API 获取数据的完整结构。文章围绕模型定义、路由配置、数据响应以及与 SwiftUI 前端的对接展开,重点不在复杂业务逻辑,而在于示范如何把一个“教学示例”扩展为更贴近真实世界的项目。
Spotlight 后台索引机制解析 (In the Background: Spotlight Indexing)
系统更新后的几天里机器发热、卡顿,很多人都知道这与 Spotlight 的重新索引有关,但它在后台如何扫描文件、何时触发重建索引、又如何调度系统资源,却鲜少被系统性梳理。Howard Oakley 基于日志与实测数据,对 Spotlight 索引的触发机制、进程行为以及对 I/O 与性能的影响进行了细致分析,提供了一次关于 macOS 内部运行机制的深入技术观察。
工具
ScreenStateKit:并发时代的 MVVM 演进
如果你欣赏 TCA 的单向数据流与可预测状态管理,却又不想在现有 MVVM 项目中彻底重构架构,那么 ScreenStateKit 状态管理库也许是一个折中方案。作者 Anthony Tran 将传统 ViewModel 拆分为两个职责清晰的部分:一个运行在 @MainActor 上、只负责持有 UI 状态的 ScreenState,以及一个以 Swift actor 实现、专门处理业务逻辑与异步任务的 ScreenActionStore,所有状态变更都通过强类型 Action 作为唯一入口,从而在保持 MVVM 结构直观性的同时,引入类似 TCA 的单向数据流与编译期并发安全。配合内建的加载与错误状态管理、重复请求防护(ActionLocker)、父子状态传播与分页支持。Anthony 亦撰写了一篇详尽的设计说明文章,对其架构理念与实践细节进行了系统阐述。
GitHub 子目录下载工具
如果你曾为了下载 GitHub 上的某个示例目录而被迫 git clone 整个仓库,这款 GitHub Downloader 显然正是为此而生。它是 Stewart Lynch 开发的一款原生 macOS 应用,允许你粘贴任意 GitHub 仓库或子目录 URL(包括 tree/branch/path 形式),自动识别默认分支,递归下载所选目录内容,并完整保留其原始层级结构。
SimTag:为模拟器标注分支上下文
在并行开发成为常态的今天,面对多个外观几乎相同的 iOS Simulator,开发者很容易迷失:到底哪个分支正在运行?是否调试了错误的构建版本?Aryaman Sharda 开发的 SimTag 会在每个 Simulator 窗口上叠加一个轻量标识,显示当前构建对应的 git 分支与提交信息。对于习惯使用 worktrees、进行 PR 审查或结合 AI 协作开发的团队来说,这是一个能够显著减少认知摩擦、避免“调错分支”的实用小工具。



Happy New Year 🎊