Weekly Comment
Two Hours Without a Smartphone
Last week, one of my belongings needed repair. The shop informed me it would take about two hours, so I set off by car to a shopping mall with only my laptop in tow. It wasn’t until I handed over my item that I realized a glaring oversight: I had forgotten to bring my smartphone. What might seem like a minor slip-up turned out to be the start of a series of unexpected inconveniences over the next two hours.
First, I looked for a café to take a break. Although my Apple Watch was linked to a few bank cards, the first several cafés I visited only accepted payments via WeChat Pay or Alipay, and at the time I completely overlooked the option of using facial recognition payment. With no cash on hand and no smartphone, I wandered across three floors of the mall before finally finding a café that accepted payment from my Watch. When I tried to use the mall’s Wi-Fi, I found I couldn’t receive the verification code without my phone. In the end, a kind server used her own phone to help me log in.
After retrieving my repaired item, I headed toward the parking lot, only to recall that the mall’s parking fee had to be paid through a WeChat mini-program. Fortunately, I still had my laptop, which allowed me to contact my wife and ask her to pay remotely on my behalf.
Of course, I’ve always understood the importance of smartphones. But not until I truly found myself without one did I fully appreciate this fact: in today’s urban life, if you haven’t made special preparations for being without your device, you might find your daily routines strikingly difficult.
In last week’s commentary, I expressed concerns about the excessive “smart” infiltration of modern electronics. Reflecting now, as an individual in this society, haven’t I already intertwined my lifestyle and work habits with these “smart” experiences?
Forewarned is forearmed. While enjoying the immense convenience of a fully “smart” world, I need to prepare for those occasional non-smart scenarios—or even more sudden societal upheavals. Perhaps these fleeting “non-smart moments” can help me reassess my relationship with technology and rediscover some core essence of life that often remains obscured behind layers of automated convenience.
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
Typefully: Say Goodbye to the Hassles of Social Media Posting
As Dave Verwer mentioned in a recent issue of iOS Dev Weekly, developers are becoming increasingly dispersed across the internet, making it unlikely for us to return to the days of relying solely on a single social media platform. In light of this trend, as a blogger, I needed a tool to simplify content posting and management across various social media platforms. Over the past month, I started using Typefully to achieve this goal. In this article, I’ll share some insights and experiences from my usage.
Follow me on BlueSky: @fatbobman.bsky.social
Recent Selections
Concurrency Step-by-Step: Reading from Storage
Many developers encounter various concurrency-related issues when migrating to Swift 6 mode. If your primary goal is simply "making the code compile," you might still be in the "appeasing the compiler" beginner phase. In this article, Matt Massicotte demonstrates multiple ways to achieve compilation through a seemingly simple code example, analyzing and comparing the implications and applicable scenarios of each approach. Matt emphasizes that when designing concurrent systems, prioritizing simplicity and maintainability is more important than blindly pursuing advanced language features.
Eight Fun SwiftUI Details in My Practice Planner
During the development of the Elite Hoops app with SwiftUI, Jordan Morgan delved into how thoughtful design details can significantly enhance user experience. By combining animations and interactive design, Morgan not only optimized functionality but also showcased the flexibility and innovation potential of SwiftUI. In this article, he shares eight interesting implementations that offer inspiration and practical tips for developers.
What Happens When You Move a File in Git?
Does Git save file diffs or complete snapshots when changes are committed? And if files or folders are renamed, does Git create new storage copies? Bruno Rocha explored these questions while planning to rename a folder with a large number of files. In this article, he shares key findings about Git's inner workings:
Git doesn't store incremental differences but instead creates complete snapshots based on file content. By using hash calculations, it avoids storing duplicate file contents.
Renaming files does not lead to duplicate storage of their contents but does create new tree objects to reflect name changes.
Frequent renaming of folders in large or complex file structures can result in many new tree objects being generated, which may increase storage overhead or reduce performance.
any and some
In Swift's protocol-oriented programming, protocol types are essential for building flexible APIs. In this article, Kyryl Horbushko provides a detailed exploration of the any
and some
keywords, their uses, and applicable scenarios. With in-depth examples and comparison tables, this article helps developers understand the differences and advantages of each keyword in real-world applications.
Simple State Sharing and Persistence in Swift
Point-Free has been gradually extracting mature and reusable functionality from the TCA framework into standalone open-source libraries. The recently released Sharing is one such library. By providing a powerful @Shared
property wrapper, Sharing enables developers to efficiently share state across multiple modules of an application and persist data to external storage systems such as UserDefaults and file systems. This library enhances state management flexibility while simplifying persistence in complex scenarios.
肘子的话
离开手机的两个小时
上周,我的一件物品需要修理,商家告诉我大约需要两个小时,于是我带上笔记本开车前往一家购物中心。直到将物品交给商家时,我才意识到犯了一个错误:忘记带手机了。这个看似不大的疏忽,在接下来的两个小时里给我带来了一连串的小麻烦。
首先,我想找个咖啡厅小憩。尽管我的 Apple Watch 已绑定了几张银行卡,但最初去的几家咖啡店只接受微信支付和支付宝,不支持其他支付方式(我当时忘记了还可以使用刷脸支付)。由于身上没有现金,我在商场里辗转了三层楼,才找到一家支持 Watch 支付的咖啡厅。当我试图使用购物中心提供的无线网络时,又因为没有手机而无法接收验证码。最后在好心服务员的帮助下,她用自己的手机帮我完成了网络登录。
取回维修物品,准备去停车场时,我又想到,家购物中心的停车费必须通过微信小程序支付。好在笔记本能联网,我赶紧联系了我夫人,请她远程帮我完成了缴费。
我当然知道手机的重要性,但直到真正离开它,才会深刻体会到:在当前的都市生活中,如果没有为手机不在身边做特别准备,生活将会异常艰难。
在上期周报中,我曾感慨当前电子设备过度智能化的问题。然而此刻我反思,作为社会中的一个个体,我何尝不是已将自己的生活和工作方式,与这种智能体验紧密绑定?
居安思危。在享受智能社会带来的巨大便利时,我确实需要为可能出现的非智能场景,乃至突发社会事件做好充分准备。或许,偶尔的“非智能时刻”,反而能帮助我重新审视自己与技术的关系,找回一些被智能遮蔽的生活本质。
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
Typefully:轻松告别繁琐的社交媒体发布
正如 Dave Verwer 在最近一期 iOS Dev Weekly 中提到的那样,开发者在互联网上的分布将变得更加分散,回到集中依赖某个特定社交媒体的时代已不太可能。面对这一趋势,作为一名博主,我需要借助工具来简化在不同社交媒体平台上的内容发布和管理。过去一个月里,我开始使用 Typefully 来完成这一工作。在本文中,我将分享使用过程中的一些心得与体会。
在 BlueSky 上关注我:@fatbobman.bsky.social
近期推荐
并发逐步解析:从存储中读取数据 (Concurrency Step-by-Step: Reading from Storage)
许多开发者在迁移到 Swift 6 模式后,往往被各种并发相关的问题困扰。如果你的首要目标只是“让编译通过”,那么你可能还处于“取悦编译器”的初级阶段。在这篇文章中,Matt Massicotte 通过一个看似简单的代码示例,演示了多种实现编译通过的方法,并对每种方案的意义和适用场景进行了分析与对比。Matt 强调,在设计并发系统时,应优先关注代码的简洁性和可维护性,而不是盲目追求使用语言的高级特性。
我的 App 中八个有趣的 SwiftUI 细节 (Eight Fun SwiftUI Details in My Practice Planner)
在使用 SwiftUI 开发 Elite Hoops 应用的过程中,Jordan Morgan 深入探索了如何通过精巧的细节设计提升用户体验。他结合动画和交互设计,不仅优化了功能实现,还充分展示了 SwiftUI 的灵活性和创新潜力。在这篇文章中,Morgan 分享了八个有趣的实现,并为开发者提供了灵感和提示。
在 Git 中移动文件会发生什么?(What Happens When You Move a File in Git?)
当我们通过 Git 提交更改时,保存的是文件的 diff 还是完整的快照?如果对文件或文件夹进行了重命名,Git 是否会生成新的存储副本?Bruno Rocha 在计划重命名一个包含大量文件的文件夹时,也对这些问题感到好奇。为此,他深入研究了 Git 的底层工作机制,并在本文中分享以下发现:
Git 并非存储文件的增量差异,而是以文件内容为基础生成完整的快照。通过哈希值计算,Git 可以避免存储重复的文件内容。
对文件的重命名不会导致文件内容的重复存储,但会生成新的树对象(tree objects),以反映名称变化。
在大型或复杂的文件结构中,频繁的文件夹重命名可能会导致大量树对象生成,从而增加仓库的存储开销或降低性能。
any and some
在 Swift 的面向协议编程中,协议类型是开发者构建灵活 API 的重要工具。Kyryl Horbushko 在这篇文章中深入解析了 any
和 some
关键字的用途及其适用场景,并通过详细的示例和对比列表,帮助开发者理解两者在实际使用中的区别与优势。
轻松实现 Swift 中的状态共享与持久化 (Simple State Sharing and Persistence in Swift)
Point-Free 在构建 TCA 的过程中,逐步将成熟且通用的功能拆分为独立的开源库,Sharing 是最新发布的成果。通过提供一个强大的 @Shared
属性包装器,Sharing 库帮助开发者在应用的多个模块之间高效共享状态,并支持将数据持久化到外部存储系统(如 UserDefaults、文件系统等)。这不仅扩展了状态管理的灵活性,还简化了复杂场景下的持久化实现。