The Rise of MCP and Apple's AI Framework Vision
Recently, across social networks, an increasing number of Model Context Protocol (MCP) users have been showcasing a diverse range of applications – from controlling Blender to create beautiful scenes to using the latest GPT-4o images to build complete comic stories. MCP has cleverly opened a gateway between large language models that primarily interact through text and the real world.
Last week, with OpenAI's announcement of Agent SDK's official support for MCP, it marked MCP's establishment as the de facto standard for communication between large models and real-world tools.
Although the MCP protocol itself isn't particularly complex, implementing a server, configuring it properly, and crafting effective prompts still require overcoming notable technical hurdles. In the coming months, MCP is likely to remain a powerful tool for professionals and tech enthusiasts. One important consideration is that its security relies entirely on the user's own judgment, making it a nontrivial challenge to integrate MCP seamlessly into the daily workflows and lives of typical users.
Considering Apple's recent announcement postponing the "More Personalized Siri" feature until next year, can we reasonably expect Apple to introduce an innovative framework similar to MCP at the upcoming WWDC 2025 (in true Apple fashion, likely not simply copying existing standards) and deeply integrate this capability into their operating system and system applications?
Combined with Apple's open strategy of not limiting itself to any specific cloud-based AI model, a system-integrated framework supporting MCP-like functionality that developers can flexibly utilize would undoubtedly be extremely attractive and offer immense potential. On one hand, it could elegantly address ordinary consumers' trust issues, while also significantly simplifying the technical challenges developers face when adapting to different large models. Taking this a step further, if MCP servers or implementations were allowed on the App Store, it would fundamentally change the current situation where MCP security is entirely the user's responsibility.
Apple's core advantage has always been in ingeniously breaking down barriers between hardware and software communication, presenting end users with a relatively controllable, safe, and complete experience. Whether as a developer or end user, I sincerely look forward to seeing this vision realized in the near future.
Previous Issue|Newsletter Archive
If you appreciate my work and want to promote your product to the Swift and iOS developer community, sponsoring my blog & newsletter could be an excellent opportunity for you.
Original
SwiftUI Environment: Concepts and Practice
SwiftUI’s Environment is a powerful and elegant mechanism for dependency injection, and almost every SwiftUI developer encounters and uses it in daily development. Not only does it simplify data transfer between views, it also opens up greater possibilities for application architecture design. In this article, we will set aside specific implementation details and instead focus on the role and boundaries of Environment within an architecture, exploring some often-overlooked yet crucial design ideas and practical experiences.
Recent Recommendations
The Composable Architecture: How Architectural Design Decisions Influence Performance
This is not a review of TCA itself, but rather an analytical piece on how architectural design impacts application performance. Karin Prater uses Krzysztof Zabłocki’s talk at Swift Heroes 2023 as a starting point to examine the performance bottlenecks TCA encountered over its evolution—and how developers addressed them. Prater points out that while TCA offers strong composability and testability, these traits can come at a significant performance cost in large-scale projects. The article encourages developers to evaluate architectural trade-offs from a practical perspective.
CustomTestStringConvertible
Swift Testing's parameterized tests help reduce code duplication and improve test performance. However, the default use of String(describing:)
often fails to convey the intent of each test case—especially as test suites grow more complex. In this article, Paul Samuels demonstrates how conforming to the CustomTestStringConvertible
protocol can provide clear, human-readable names for each test case, improving readability in the Xcode Navigator. He also shares advanced tips such as wrapping common types (like Bool
) with description helpers and suggests workarounds for current macro limitations.
Building Flexible, Styled ListItems in SwiftUI
In a real-world project, Magnus Jensen needed a list item component supporting four text elements: Label, Title, Subtitle, and Detail. He designed a flexible ListItem
component with a slot-based system by defining a ListItemSlotable
protocol and a generic _ListItemSlotted
wrapper, enabling the seamless injection of leading/trailing content without breaking the layout. This slot-based design improves composability and avoids nested view clutter. To simplify usage, a string-based initializer is also provided. The article showcases how to build powerful yet clean components aligned with SwiftUI principles.
SwiftUI TabView: Explained with Code Examples
TabView
has evolved steadily in SwiftUI—from basic tab switching to supporting swipe-based pagination (Pager), and more recently, sidebar-adaptable styles and grouped configurations in iOS 18. In this article, Antoine van der Lee provides a comprehensive walkthrough of both basic and advanced usages of TabView
through practical code examples.
ModelActor is Just Weird
Matt Massicotte shares his real-world experience working with @ModelActor
in two SwiftData projects—as someone relatively new to the framework. The article breaks down the actor’s context-sensitive behavior, its subtle interactions with MainActor
, and the concurrency challenges posed by the non-Sendable nature of ModelContext
. Matt builds a set of safe extension methods for performing context-bound async operations inside an actor and proposes a Database
abstraction that supports both main-thread and background access.
Outside of test scenarios, I personally wouldn't adopt the
withContext
pattern to inject closures into actors—but Matt's concurrent programming insights are nonetheless impressive.
Strategies to Avoid Merge Conflicts in Xcode Projects
Xcode’s project.pbxproj
file has long been a notorious source of Git merge conflicts in collaborative workflows. In this article, Pedro Piñera outlines multiple strategies to mitigate this pain: splitting large projects, using tools like Tuist and XcodeGen for project generation, managing local projects via SwiftPM, and leveraging Xcode 16’s new “Synchronized Groups” feature to reduce structural churn with minimal overhead.
Introducing Swiftly 1.0: Swift Toolchain Version Manager
In this post, Chris McGee introduces Swiftly 1.0, the officially released toolchain version manager from the Swift team. Swiftly allows developers to quickly install, switch, and update Swift toolchains. It supports macOS and major Linux distributions, and enables team-wide version consistency using the .swift-version
file. Written entirely in Swift, it offers a portable and developer-friendly experience, making it the recommended way to install Swift outside of Xcode.
Swiftly was originally created by Patrick Freed and has since been donated to the Swift community.
MCP 崛起与苹果的 AI 框架设想
在最近一段时间,在社交网络上,越来越多的 Model Context Protocol(MCP)使用者展示了各种丰富多彩的应用场景,从操控 Blender 创建精美场景,到利用最新的 GPT-4o 图片构建完整的漫画故事。MCP 巧妙地打开了以文本为主要互动手段的大模型,与现实世界之间的大门。
上周,随着 OpenAI 宣布 Agent SDK 对 MCP 的正式支持,这标志着 MCP 已经成为了大模型和现实工具通讯上的事实标准。
尽管 MCP 的协议本身并不特别复杂,但无论从 Server 的实现、配置,还是提示词构建,仍然需要跨越一定的技术门槛。在接下来几个月,MCP 更多地仍将是专业人士和技术发烧友的得力助手(效率工具)。特别值得考虑的是,MCP 在安全方面完全依赖于使用者本身的判断,对于绝大多数普通用户来说,如何将其无缝融入日常工作和生活仍然是一项不小的挑战。
考虑到苹果不久前宣布将“More Personalized Siri”功能推迟到明年,我们是否可以合理预期,在即将到来的 WWDC 2025 上,苹果会推出一个类似 MCP 的创新框架(根据苹果一贯的风格,很可能不会简单照搬现有标准),并在操作系统和系统应用中深度集成该能力?
结合苹果不局限于某个特定云端 AI 大模型的开放策略,一个包含在系统中、支持类似 MCP 功能且可被开发者灵活调用的框架无疑是极具吸引力和想象空间的。一方面可以优雅解决普通消费者的信任痛点,同时也能显著简化开发者适配不同大模型的技术烦恼。进一步设想,如果再增加允许 MCP 服务器或实现在 App Store 上线的可能性,无疑会从根本上改变 MCP 的安全性完全由使用者自己负责的现状。
苹果长久以来的核心优势都在于如何巧妙打通软硬件沟通的壁垒,给最终用户呈现一个相对可控、安全、完整的体验。无论作为开发者还是最终用户,我都衷心期待看到上述愿景在不久的将来得到实现。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
SwiftUI Environment:理念与实践
SwiftUI 的 Environment 是一个优雅且功能强大的依赖注入机制,几乎每个 SwiftUI 开发者都会在日常开发中接触和应用。这一机制不仅简化了视图间的数据传递,也为应用架构设计提供了更多的可能性。本文将暂且搁置具体的实现细节,转而聚焦于 Environment 在架构中的角色与边界,探讨那些常被忽视却至关重要的设计理念与实践经验。
近期推荐
从 TCA 的演进看架构设计对性能的影响 (The Composable Architecture: How Architectural Design Decisions Influence Performance)
这不是一篇 TCA 的框架评测,而是一篇探讨“架构设计如何影响应用性能”的分析文章。Karin Prater 以 Krzysztof Zabłocki 在 Swift Heroes 2023 的演讲为切入点,分析了 TCA 在发展过程中遭遇的性能瓶颈及其应对思路。Prater 指出,尽管 TCA 在可组合性和可测试性方面有诸多优势,但在大型项目中,这些特性也可能带来不容忽视的性能代价。文章鼓励开发者从实践出发,权衡架构设计与性能表现之间的取舍。
让参数化测试更具可读性 (CustomTestStringConvertible)
Swift Testing 的参数化测试虽能有效减少重复代码、提升并发执行效率,但默认基于 String(describing:)
的用例名称,往往无法准确传达测试意图,尤其在测试套件变复杂后尤为明显。Paul Samuels 在本文中介绍了如何通过实现 CustomTestStringConvertible
协议,让每个测试用例拥有清晰可读的描述,从而提升 Xcode Navigator 中的可读性。作者还分享了进阶技巧,例如为常见类型(如 Bool
)封装描述生成工具,并提出了在当前宏系统限制下的替代方案。
打造灵活且可定制样式的 SwiftUI 列表项 (Building Flexible, Styled ListItems in SwiftUI)
在实际项目中,Magnus Jensen 需要一个支持 Label、Title、Subtitle 和 Detail 四种文本内容的列表项组件,因此创建了灵活可扩展的 ListItem
。他通过定义 ListItemSlotable
协议和泛型包装器 _ListItemSlotted
,实现了在不破坏原组件结构的前提下,为列表项灵活插入前置(leading)和尾部(trailing)内容的能力。这种插槽式设计增强了组件的可组合性,避免了常见的视图层级混乱问题。为了简化调用,还提供了基于字符串的初始化方式。本文展示了如何以符合 SwiftUI 思维的方式构建简洁而强大的组件系统。
TabView 全面解析 (SwiftUI TabView: Explained with Code Examples)
TabView
的能力在 SwiftUI 中持续演进:从最早的标签页(Tab)切换,到引入滑动分页(Pager)行为,再到 iOS 18 支持侧边栏(Sidebar)样式与分组配置,逐步成长为多平台通用的导航组件。在本文中,Antoine van der Lee 通过多个实用代码示例,系统讲解了 SwiftUI TabView
的基础与进阶用法。
ModelActor 真有点怪 (ModelActor is Just Weird)
Matt Massicotte 以一位“刚接触 SwiftData 的开发者”视角,分享了他在两个项目中使用 @ModelActor
的真实体验。文章剖析了 ModelActor
初始化过程对线程上下文的依赖、与 MainActor
的微妙关系,以及 ModelContext
非 Sendable 特性所带来的并发访问挑战。Matt 还构建了一套扩展方法,帮助我们安全地在 actor 内执行带有 context
的异步操作,并提出了一个支持主线程与后台访问的 Database
抽象。
除了测试用例外,我个人通常不会采用文中介绍的
withContext
模式将闭包注入 actor。但 Matt 在构建这一机制过程中展现出的并发技巧,确实令人印象深刻。
Xcode 项目中避免合并冲突的策略 (Strategies to Avoid Merge Conflicts in Xcode Projects)
Xcode 的 project.pbxproj
文件长期以来都是团队协作中的“冲突温床”。Pedro Piñera 在本文中总结了多种有效的缓解策略:从经典的多项目拆分、使用 Tuist / XcodeGen 进行项目生成,到将 SwiftPM 作为本地项目管理工具,再到 Xcode 16 中引入的“同步文件夹(Synchronized Groups)”功能,以更低的维护成本减少频繁的结构变动所带来的合并冲突。
Swiftly 1.0 发布:Swift 工具链版本管理器
由 Chris McGee 撰写的这篇文章,介绍了 Swift 团队正式发布的 Swift 工具链版本管理器 Swiftly 1.0。该工具可用于快速安装、切换、更新 Swift 工具链,支持 macOS 和主流 Linux 发行版,并可通过 .swift-version
文件统一团队使用的 Swift 版本。Swiftly 完全由 Swift 编写,具备良好的可移植性和开发体验,是在 Xcode 之外安装 Swift 的推荐方式。
📚 查看安装文档
Swiftly 最初由 Patrick Freed 开发,并已将其捐赠给 Swift 社区。
基于 RxSwift 编写的 iOS wanandroid 客户端
WanAndroid 是一个知名的中文安卓学习社区,本项目由 seasonZhu 基于其开放 API 编写的 iOS 客户端。实现本身并不复杂,但值得一提的是,作者过去几年内曾分别使用 SwiftUI、Flutter、uni-app 和 ArkTS(HarmonyOS)开发过同类项目。通过围绕相同业务需求进行跨平台、多框架的实现,作者不仅加深了对各平台差异的理解,也形成了自己的一套组件化与响应式开发思路。对希望探索跨平台开发策略的读者来说,这是一个颇具参考价值的项目。