Fatbobman's Swift Weekly #083
Don't Let Vibe Coding Hinder Your Technical GrowthA few days ago, a friend who had previously highly praised and fully embraced Vibe Coding posted a tweet expressing his recent frustration with AI-based programming:
I believe this sentiment resonates with many developers. Today's large language models often demonstrate astonishing capabilities in areas we're less familiar with, leaving a profound first impression that creates unrealistically high expectations. However, with deeper use, we gradually discover that AI's limitations are far more significant than we initially imagined. All along, I've limited AI's role in my programming to specific areas: generating and refining documentation, optimizing code at the function level, and helping me understand and learn unfamiliar frameworks and technical details. Even with these constraints, the efficiency gains that AI brings remain impressive. More valuable still is that with AI's assistance, I can feel my skills continuously improving, and this growth gives me confidence in mastering technology. Thinking back to the social panic triggered when ChatGPT first appeared (fears of human replacement leading to massive unemployment), these predictions haven't materialized. Instead, as people's understanding of AI's capabilities and limitations has become clearer, the focus has shifted to how AI can assist human work rather than completely replace it. AI, like all tools throughout human history, is essentially an extension of human capability. If you're experiencing difficulties using it, perhaps you should reflect on whether your approach to viewing and using it is appropriate. "Enjoy the vibe, but don't get lost in it." While Vibe Coding as an emerging programming paradigm certainly makes programming more efficient and enjoyable, it shouldn't become an excuse for abandoning deep learning and understanding of technology. We should view AI's capabilities rationally, improving efficiency while not forgetting the original intention of technical excellence. Perhaps in the future, AI may replace us in "typing" code, but we must retain the initiative in thinking and creativity. 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. OriginalFrom 180 cm to 5′ 11″: A Complete Guide to Swift MeasurementIn everyday life we constantly convert values between different units of measurement. For developers this seems easy—write a few formulas, sprinkle in a couple of 【Tip】Controlling Access Within a Swift PackageRecent RecommendationsTen Years Older, Voice Takes OverThe third Thursday of May marks Global Accessibility Awareness Day (GAAD). Despite Apple’s well-designed accessibility APIs, many developers still overlook this essential aspect of user experience because it “feels too complicated.” In this article, Edvinas Byla reflects on adding full VoiceOver support to his ten-year-old game Decrypto. Through SwiftUI’s accessibility APIs, he transitions from complete neglect to intentional, inclusive design. Byla emphasizes that most SwiftUI components come with solid default accessibility behavior, and a handful of modifiers cover 90% of what’s needed. This piece is not only a practical case study but also an honest call to design for everyone. Adding Dependencies to Binary Swift PackagesSwiftPM’s SwiftUI View Model OwnershipWhen a SwiftUI view needs to own its ViewModel’s lifecycle but also initialize it based on a parameter, subtle bugs and state management issues often arise. In this article, Chris Eidhof analyzes common pitfalls and walks through several iterations toward a more robust solution. His key takeaway: “If you can’t initialize your Why We Keep Avoiding Tests in iOS—And What the Tools Should Do About ItIf you don’t enjoy writing tests for iOS, this article might validate your feelings—it’s not laziness, it’s tooling. Karin Prater offers a sharp critique of Apple’s testing ecosystem, especially in the context of SwiftUI. While UI building has improved dramatically, testability still lags far behind. Prater outlines six essential pillars for better SwiftUI testing: speed, stability, feedback, interaction, precise assertions, and maintainability. A follow-up post will introduce a testable SwiftUI pattern worth watching. Cocoa BasicsDespite SwiftUI’s maturity, some developers still prefer building native macOS apps with pure AppKit, entirely in code. That’s exactly what Luna Razzaghipour sets out to do in her Cocoa Basics series: no templates, no GUI editors—just code. The series begins with the smallest possible Cocoa app, manually building the Reducing Noise by Searching LogUI’s ViewsmacOS app launches can generate tens of thousands of log entries in mere seconds, making analysis tedious and error-prone. In this article, Howard Oakley demonstrates how to use his tool LogUI to open multiple windows on the same log view, each searching for different keywords. This multi-angle approach helps break down and trace each stage of the app launch process, greatly improving clarity and efficiency. Toolsxtool
XogotGodot is a popular open-source game engine, recently gaining official support for running on visionOS. Xogot takes things further by bringing the full Godot 4.4 experience natively to iPad. It supports in-app execution and debugging, includes 2D/3D scene editors, a native code editor, and full debugging tools. Optimized for iPadOS with support for touch, Apple Pencil, and multiwindow, Xogot’s entire UI is written in SwiftUI, offering a native feel for game developers on the go. 别让 Vibe Coding 阻碍了你的技术成长几天前,一位之前高度赞扬并全身投入 Vibe Coding 的好友发表了一篇推文,表达了他近期基于 AI 编程的挫败感:
我想这种情绪也会出现在不少开发者身上。当今的大语言模型往往能在我们不太熟悉的领域展现惊人能力,给我们留下深刻的第一印象,从而产生过高期待。然而深入使用后,我们才逐渐发现 AI 的局限性远比想象中更为明显。 一直以来,我在编程中都将 AI 的参与限制在特定范围内:生成并完善文档、以函数为单位对代码进行优化、帮助我理解和学习陌生的框架与技术细节等。即便如此,AI 带来的效率提升依然令人惊叹。更可贵的是,在 AI 的辅助下,我能感受到自己技能的不断提升,这种成长给了我掌控技术的信心。 回想 ChatGPT 刚出现时引发的社会恐慌(人力将被取代,导致大量失业),这些预言并未成真。相反,随着人们对 AI 能力边界的认识逐渐清晰,讨论焦点已转向如何借助 AI 辅助人工,而非完全替代人工。AI 作为一种工具,与人类历史长河中所有工具一样,本质上是人类能力的延伸。如果你觉得在使用过程中遇到了困境,或许应该反思自己看待和使用它的方式是否恰当。 “享受氛围,但不要沉沦其中”。Vibe Coding 作为新兴的编程范式确实让编程更高效也更有趣,但它不应成为我们放弃深入学习和理解技术的借口。理性看待 AI 的能力边界,在提高效率的同时,不忘技术精进的初心。或许未来 AI 能代替我们“敲“代码,但我们必须掌握思考和创造的主动权。 如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。 原创从 180 cm 到 5′ 11″:Swift Measurement 全解析在日常生活里,人们经常需要在各种度量衡单位之间转换。对开发者而言,实现这类功能看似简单:写几行公式、做几次 【Tip】将访问权限控制在 Swift Package 内近期推荐十年后,我为游戏加上了无障碍支持 (Ten Years Older, Voice Takes Over)每年五月的第三个星期四是全球无障碍宣传日 (GAAD)。尽管苹果为无障碍开发提供了完善的 API 体系,许多开发者依然因为“看起来太麻烦”而忽略了这块用户体验的基础工程。在这篇文章中,作者 Edvinas Byla 回顾了自己为十年前的游戏 Decrypto 补上 VoiceOver 支持的全过程——通过 SwiftUI 的无障碍 API,他完成了从“完全忽略”到“主动设计”的认知转变。Byla 指出,大多数 SwiftUI 控件本身已经具备良好默认行为,而常见的几个修饰符就能覆盖 90% 以上的无障碍需求。这篇文章不仅是一个 VoiceOver 实践案例,也是一份关于“为所有人设计”的真诚倡议。 给二进制 Swift 包加上依赖的变通法 (Adding Dependencies to Binary Swift Packages)虽然 SwiftPM 的 SwiftUI 中的 ViewModel 生命周期管理 (SwiftUI View Model Ownership)在 SwiftUI 中,如果一个视图既需要拥有 ViewModel 的生命周期,又希望根据传入参数初始化它,就可能触发一系列状态管理的陷阱和隐性 bug。Chris Eidhof 在本文中分析了这些问题,并展示了从错误实现到渐进式修复的全过程。他总结出一条重要的实践经验:“如果你无法在声明时初始化 为什么我们总是不想写 iOS 测试?(Why We Keep Avoiding Tests in iOS)如果你不爱写测试,本文也许能为你“辩护”:不是你懒,而是工具不给力。Karin Prater 系统梳理了苹果开发生态中各类测试工具的优劣,指出 SwiftUI 虽革新了 UI 构建方式,却在可测试性方面严重缺位。Prater 提出构建良好 SwiftUI 测试体验所需的六个关键维度:速度、稳定性、反馈、交互、精确断言与可维护性。在后续文章中,作者还将分享一个可实际落地的 SwiftUI 测试模式,值得关注。 Cocoa 入门手册 (Cocoa Basics)尽管 SwiftUI 越发成熟,仍有不少开发者渴望用纯 AppKit 代码(不依赖 Xcode GUI 工具)构建原生 macOS 应用。这正是 Luna Razzaghipour 在《Cocoa Basics》系列中要做的事:不用模板、不靠 IDE,全程只写代码。教程从构建最小可运行的 Cocoa 应用入手,手动搭建 用 LogUI 多窗口搜索提高日志分析效率 (Reducing Noise by Searching LogUI’s Views)macOS 应用在启动的短短几秒内就可能生成数万条日志,分析起来既费力又低效。Howard Oakley 在本文中展示了如何借助他开发的工具 LogUI,通过多窗口并行搜索同一日志视图中的不同关键词,分阶段拆解和追踪 app 启动过程中的关键事件,大大提升了日志分析的可读性与效率。 工具xtool
XogotGodot 是一款广受欢迎的开源游戏引擎,最近还获得了 Apple 对其在 visionOS 上运行的官方支持。而 Xogot 则进一步拓展了它的使用场景 —— 这是一个将 Godot 4.4 完整移植到 iPad 的原生应用,现已登陆 App Store。Xogot 支持在 iPad 上直接运行和调试 Godot 项目,内置 2D/3D 场景编辑器、代码编辑器、调试器等全套工具,并针对触控操作、Apple Pencil 和多窗口使用场景进行了优化。整个 UI 基于 SwiftUI 重写,体验上更贴近 iPadOS 的原生范式。 戴铭的小册子最初作为一款聚焦 Apple 生态内容汇总与技术资料管理的开源项目 SwiftPamphletApp,如今在作者 戴铭 的推动下迎来 6.6.7 版的重大更新:正式更名为《小册子》,并完成从“开发工具箱”到“知识宇宙”的转型。新版小册子融合了代码技巧、人文思考、历史纵览与播客拓展阅读,是一个集“技术资料 + 知识花园 + 灵感收纳”为一体的现代数字笔记应用,满足碎片学习、深度阅读与兴趣探索的多重场景。 应用代码依然保持开源,并可从 App Store 下载体验。 求贤招聘全职 iOS 开发工程师杭州夏猫科技正在招聘一位全职 iOS 开发工程师,项目主要采用 SwiftUI 开发,最低适配 iOS 17,工作地点位于杭州。如果你正好对 SwiftUI 项目感兴趣,也许这就是你在找的机会。 🔍 查看职位详情 Welcome to my blog Fatbobman's Swift Blog( 肘子的Swift记事本 ) |