Weekly Comment
Master Technology, Don't Let It Master You
It's been over 20 years since "Harry Potter and the Philosopher's Stone" first hit theaters. With recent theatrical re-releases, I've started revisiting this classic series, having just watched the third installment, "Harry Potter and the Prisoner of Azkaban" yesterday.
Watching one film per week has allowed me to not only appreciate the storylines but also quickly observe the characters' growth and the technological advancement in filmmaking over the nearly decade-long production. It's evident that the visual quality and production value improved with each installment. However, one crucial point stands out: regardless of how magnificent and grand the scenes became, in the Harry Potter films, these special effects remained faithful to serving the story itself, enhancing the narrative rather than overshadowing it.
In the past five or six years, I've rarely encountered blockbuster films that have left a lasting impression. Despite significant improvements in special effects technology and reduced costs, I often forget the plot of many films before even leaving the theater. All that lingers are vague memories of dazzling special effects, while the film's intended message gets lost in an endless array of technological applications. It seems that as the film industry gained access to more resources, it somehow lost its ability to tell stories with grace.
This phenomenon of technology overshadowing substance reminds me of the current AI development landscape. In today's rapidly evolving AI era, many creators are eagerly embracing AI. However, as individuals, we should maintain a clear perspective: to stay competitive in the AI age, the key isn't blindly chasing the latest technology, but rather leveraging AI to enhance our own capabilities instead of becoming addicted to its short-term conveniences.
Take the currently popular Cursor as an example - while it can significantly boost development efficiency, over-reliance on its convenience can inadvertently dull our coding intuition and gradually erode our deeper understanding of technology. Master technology, don't let it master you — at least for me, this is a warning that needs to be constantly remembered.
Previous Issue|Newsletter Archive
If you appreciate my work and want to promote your product to the Swift and iOS developer community, sponsoring my platform could be an excellent opportunity for you.
Your support through Patreon, or Buy Me a Coffee helps keep this newsletter and blog running. Thank you for finding this content helpful!
Originals
Comprehensive Guide to Mastering KeyPath in Swift
In the world of Swift, KeyPath
is a powerful yet often underestimated feature. Many developers use it inadvertently in their daily programming without fully realizing its potential and importance. This article aims to delve deeply into the functional characteristics of KeyPath
, revealing its unique charm in Swift programming, and helping you transform it into a powerful assistant in your development process.
Recent Selections
SwiftUI Craftsmanship: View Contracts
This article is the first in the "SwiftUI Craftsmanship" series, where Danny Bolella emphasizes the importance of thoughtfully considering the question, “What is this view meant to do?” when designing SwiftUI views. By defining appropriate view contracts (interfaces), developers can avoid rigid dependencies on specific data types, enhancing flexibility and reusability. Bolella provides an analogy: a skilled carpenter knows the larger project they are building, but for each part, they must ask, “What is this piece supposed to do?” and ensure it fits into the broader design.
Exploring Swift Macros in Business Development
Since the introduction of macros in Swift 5.9, more developers have realized the significant role macros play in improving development efficiency. In addition to using predefined macros, creating custom macros tailored to specific business needs can greatly streamline workflows and simplify code. In this article, tit not only delves into the basics and advanced usage of Swift macros but also demonstrates how customized macros reduce redundancy and enhance development processes within the Bilibili membership center module.
AnyView is Everywhere in Xcode 16
In this article, Toomas Vahter highlights a key change in Xcode 16: in debug builds, all SwiftUI views are wrapped in AnyView
. This design aims to accelerate mode switching and improve preview performance by sharing build artifacts. However, in some cases (such as with List
), this approach may hinder performance optimizations. Vahter advises developers to be aware of this change to avoid unnecessary debugging efforts and performance issues.
Cursor
Recently, articles about using Cursor for development in the Apple ecosystem have surged, with each offering unique insights and perspectives.
Thomas Ricouard shares his experience with Cursor in How to Use Cursor for iOS Development, providing detailed configuration steps and recommendations for iOS developers.
Junping focuses on using Inject to build Xcode-like preview experiences within Cursor, showcasing how to replace traditional tools with a new workflow.
Ethan Huang is producing a series of videos, focusing on how to achieve seamless switching between Cursor and Xcode, offering developers more flexibility in using multiple tools.
These insights not only demonstrate the diverse applications of Cursor but also provide Apple developers with more versatile options in their development workflows.
Swift Testing
Swift Testing is a testing framework designed specifically for Swift and is integrated into Xcode 16, making it the officially recommended testing tool. Its powerful features are likely to captivate developers upon use. Last week, several well-known bloggers published articles related to Swift Testing.
In Vapor and Swift Testing: Running Tests in Parallel, Antoine van der Lee shares how he optimized testing performance using Swift Testing in the backend of his Vapor-based project and explores the advantages and challenges of parallel testing.
Additionally, Majid Jabrayilov and Donny Wals have released introductory guides on Swift Testing: Introducing Swift Testing. Basics and Swift Testing Basics Explained. These tutorials offer clear, practical insights and techniques for developers to get started with Swift Testing.
肘子的话
让技术为我所用,不要被其反噬
距离《哈利·波特与魔法石》的首次上映已经过去了 20 多年。最近影院在搞重映,我也开始重温这个经典系列,昨天刚看完第三集《哈利·波特与阿兹卡班的囚徒》。
因为采用了每周一部的节奏,在这次回顾中,除了感受剧情外,还得以快速地看到影片中小伙伴们的成长过程,以及电影工业在近十年拍摄过程中技术的提高。可以明显感受到,每集的画面和质感都会相较于上一集有改善。不过,有一点很重要:无论最终呈现了什么样的壮丽、恢弘场景,在哈利·波特电影中,这些特效仍忠实地服务于电影本身,是为了更好地展现剧情,并没有喧宾夺主。
在最近的五六年中,已经很少有让我留下深刻印象的大制作电影了。尽管特效技术有了极大的提升、成本也进一步降低,但很多影片我几乎在还没走出影院时就忘记了剧情。只会隐约记得有很多炫酷的特效,而影片想表达的主旨反倒淹没在无尽技术的应用之中。似乎,当电影工业掌握了更多的资源后,反倒不知道该如何平和地讲述一个故事了。
这种技术喧宾夺主的现象让我联想到当下 AI 技术的发展。在 AI 高速发展的今天,很多创作者争相投入 AI 的怀抱。然而作为个体,我们更应该清醒地认识到:要在 AI 时代保持竞争力,关键不在于一味追逐最新技术,而在于让 AI 成为增强我们自身能力的助力,而非沉迷于它带来的短期便利。
以当下火爆的 Cursor 为例,它确实能显著提升开发效率,但过度依赖它的便利,不经意间会钝化我们对代码的直觉,也会逐渐侵蚀我们对技术深层次的理解。让技术为我所用,不要被其反噬 —— 至少对我而言,这是一条需要时刻铭记的警示。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
从基础到进阶:Swift 中的 KeyPath 完全指南
在 Swift 的世界里,KeyPath
是一个强大而又常被低估的特性。许多开发者在日常编程中不经意间使用它,却未能充分认识到它的潜力和重要性。本文旨在深入剖析 KeyPath
的功能特性,揭示其在 Swift 编程中的独特魅力,帮助你将它转化为开发过程中的得力助手。
近期推荐
🪜 SwiftUI 工匠之道:视图契约 (SwiftUI Craftsmanship: View Contracts)
本文是“SwiftUI 工匠之道”系列的第一篇,Danny Bolella 强调在设计 SwiftUI 视图时,开发者应认真思考“这个视图是用来做什么的?”,从而设计出合适的视图契约(接口)。过度依赖特定数据类型的视图会限制其灵活性和可复用性。他举了一个例子:优秀的木匠清楚自己正在建造的整体项目,但在处理项目的每个部分时,他们必须问:“这个部件是用来做什么的?”并将其与整个项目相关联。
Swift Macro 在业务开发中的探索与实践
自从 Swift 5.9 引入宏功能后,越来越多的开发者开始意识到宏在开发中的重要作用。除了大量使用预置宏之外,根据业务需求定制自定义宏,能够显著提升开发效率并简化代码流程。本文中,tit 不仅深入讲解了 Swift 宏的基础和进阶用法,还展示了如何在 Bilibili 会员中心模块开发过程中,通过自定义宏减少冗余代码的编写,优化整体开发体验。
Xcode 16 中,AnyView 无处不在 (AnyView is everywhere in Xcode 16)
在本文中,Toomas Vahter 介绍了 Xcode 16 中的一项新变化:在调试模式下构建 SwiftUI 应用时,所有视图都会被包裹在 AnyView
中。这一设计初衷是通过共享构建产物,加快不同模式之间的切换,并提升预览速度。但在某些情况下(如 List
),这一处理方式可能会阻碍性能优化。Vahter 提醒开发者留意该行为带来的影响,避免因误判而陷入调试陷阱。
Cursor
近期关于如何在苹果生态开发中使用 Cursor 的文章层出不穷,每篇文章都从不同角度分享了各自的见解和经验。
Thomas Ricouard 在 How to use Cursor for iOS development 一文中,分享了他使用 Cursor 的体验,并为 iOS 开发者提供了详细的配置步骤和建议。
Junping 强调了通过 Inject 实现在 Cursor 中构建类似 Xcode 预览的开发体验,展示了如何在新的工作流中替代传统工具。
Ethan Huang 正在制作系列视频,重点介绍如何在 Cursor 和 Xcode 之间实现无缝切换,帮助开发者更灵活地使用多种开发工具。
这些分享不仅展示了 Cursor 在开发流程中的多样化应用,也为苹果生态开发者提供了更加多样化的选择。
Swift Testing
Swift Testing 是专为 Swift 语言设计的测试框架,并集成在 Xcode 16 中,成为官方推荐的测试工具。一旦使用它,你很可能会被其强大的功能所吸引。上周,多位知名博主纷纷发表了与 Swift Testing 相关的文章。
在 Vapor and Swift Testing: Running tests in parallel 中,Antoine van der Lee 分享了他在使用 Vapor 构建后端时如何借助 Swift Testing 优化测试性能,并深入探讨了并行测试的优势与挑战。
此外,Majid Jabrayilov 和 Donny Wals 也分别推出了 Swift Testing 的入门指南:Introducing Swift Testing. Basics 和 Swift Testing basics explained,为开发者提供了清晰易懂的教程和实用技巧。