Fatbobman's Swift Weekly #077
The Rise of MCP and Apple's AI Framework VisionRecently, 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. OriginalSwiftUI Environment: Concepts and PracticeSwiftUI’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 RecommendationsThe Composable Architecture: How Architectural Design Decisions Influence PerformanceThis 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. CustomTestStringConvertibleSwift Testing's parameterized tests help reduce code duplication and improve test performance. However, the default use of Building Flexible, Styled ListItems in SwiftUIIn a real-world project, Magnus Jensen needed a list item component supporting four text elements: Label, Title, Subtitle, and Detail. He designed a flexible SwiftUI TabView: Explained with Code Examples
ModelActor is Just WeirdMatt Massicotte shares his real-world experience working with
Strategies to Avoid Merge Conflicts in Xcode ProjectsXcode’s Introducing Swiftly 1.0: Swift Toolchain Version ManagerIn 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
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 的参数化测试虽能有效减少重复代码、提升并发执行效率,但默认基于 打造灵活且可定制样式的 SwiftUI 列表项 (Building Flexible, Styled ListItems in SwiftUI)在实际项目中,Magnus Jensen 需要一个支持 Label、Title、Subtitle 和 Detail 四种文本内容的列表项组件,因此创建了灵活可扩展的 TabView 全面解析 (SwiftUI TabView: Explained with Code Examples)
ModelActor 真有点怪 (ModelActor is Just Weird)Matt Massicotte 以一位“刚接触 SwiftData 的开发者”视角,分享了他在两个项目中使用
Xcode 项目中避免合并冲突的策略 (Strategies to Avoid Merge Conflicts in Xcode Projects)Xcode 的 Swiftly 1.0 发布:Swift 工具链版本管理器由 Chris McGee 撰写的这篇文章,介绍了 Swift 团队正式发布的 Swift 工具链版本管理器 Swiftly 1.0。该工具可用于快速安装、切换、更新 Swift 工具链,支持 macOS 和主流 Linux 发行版,并可通过 📚 查看安装文档
基于 RxSwift 编写的 iOS wanandroid 客户端WanAndroid 是一个知名的中文安卓学习社区,本项目由 seasonZhu 基于其开放 API 编写的 iOS 客户端。实现本身并不复杂,但值得一提的是,作者过去几年内曾分别使用 SwiftUI、Flutter、uni-app 和 ArkTS(HarmonyOS)开发过同类项目。通过围绕相同业务需求进行跨平台、多框架的实现,作者不仅加深了对各平台差异的理解,也形成了自己的一套组件化与响应式开发思路。对希望探索跨平台开发策略的读者来说,这是一个颇具参考价值的项目。 Welcome to my blog Fatbobman's Swift Blog( 肘子的Swift记事本 ) |