Weekly Comment
My "Adventure" Journey to Hangzhou
Last week, I embarked on an "adventure" journey to Hangzhou.
During the Let's VisionOS event in Beijing this April, I noticed a tall boy, Ryan Zhu, helping out with various tasks alongside the event organizers. To my surprise, I learned that he was only 17 years old and still in his second year of high school. Ryan had traveled from Hangzhou not only to attend the event but also to learn about event organization.
Soon after, I came across news about an event being prepared by Ryan and his many friends - a hackathon called AdventureX 2024|Escape Plan, targeting young people aged 16-26. On their official website, this event was described as China's first youth-oriented hackathon organized by students and the community. Through a podcast interview, I learned that most of the organizers were students, with a significant portion being middle school students. The more I learned, the more curious I became, but also increasingly concerned: Could such a team really support a 5-day event with hundreds of participants?
Upon receiving Ryan's invitation, I gladly accepted to conduct a SwiftUI-related workshop, but this didn't completely dispel my doubts.
However, the moment I stepped into the venue, all my worries vanished. Looking at everything around me, I couldn't help but think: Perhaps only an event led and participated by young people could create such a vibrant and creative atmosphere.
The success of the event was evident in the state of each participant. Seeing the young faces, all fully focused and passionate, made me realize that perhaps only at this age can one so wholeheartedly immerse themselves in an adventure full of unknown challenges.
Let's look forward to AdventureX 2025 together!
Previous Issue|Newsletter Archive
If you find this weekly newsletter or my blog helpful, I would greatly appreciate your consideration of making a donation through Patreon, or Buy Me a Coffee.
Originals
Developing an Infinite Four-Direction Scrollable Pager with SwiftUI
In this article, we will analyze the key ideas in implementing an infinite four-way scrolling pagination component. discuss the points that need special attention, and candidly review the shortcomings of SwiftUI in coping with such scenarios. Through this case, we not only learn the specific technical implementation but also better understand how to break through the convention and solve problems creatively within the framework of SwiftUI.
Recent Selections
Analysis of System Crashes Caused by CrowdStrike
Recently, a technical mishap at cybersecurity firm CrowdStrike triggered a massive system crash globally, severely affecting key service sectors in multiple countries.
Zach Vorhies (former Google employee who disclosed Google's "Machine Learning Fairness," an AI system that censors and controls access to information) analyzed the root of the problem in his tweet. He pointed out that null pointer errors in C++ programming and a lack of effective quality control were the main reasons for the disaster. Vorhies suggested adopting modern programming languages like Rust to prevent such issues and called on Microsoft to improve its driver rollback strategies to prevent system-wide crashes caused by single driver issues. This event highlights the importance of programming language selection and quality control in the development of high-privilege system components.
Tavis Ormandy (Google vulnerability researcher) disagreed with Zach Vorhies’ views. In his tweet, he pointed out that the issue was not caused by null pointers, "This code is reading pointers from a table in a loop, and some of them are invalid. This could be due to errors in parsing a configuration file, leading to some entries being uninitialized."
Swift 6
In Swift 6, the Data Race Safety feature was supposed to help developers automatically identify and resolve difficult-to-track concurrency issues. However, Alex Grebenyuk expresses his concerns and doubts about this in his article. He notes that this feature effectively shifts a significant amount of work onto developers, especially when enabling Swift 6 mode turns previous warnings into compilation errors, potentially leading to thousands of errors when dealing with large codebases. Therefore, Alex suggests treating concurrency errors as warnings, making these warnings optional and not mandatorily tied to Swift 6 mode, and supporting continuous iterative improvements rather than prematurely locking in the design. He also criticizes the direction of Swift's recent feature development, questioning whether these changes have genuinely enhanced development efficiency. The article calls on Apple to return to Swift’s original principles—keeping the language fast and simple and focusing on boosting developers' productivity rather than increasing their workload. Alex's analysis reflects some senior Swift developers' expectations and concerns about the language's future direction.
Discussions on Xcode 16
In this overview, Michael Tsai gathers diverse feedback from the developer community on Xcode 16, introduced at WWDC 2024. The new version brings highly anticipated features like AI-driven code auto-completion (Swift Assist) among others, sparking some controversy. Developers have mixed reviews about the AI functionalities, praising its context-aware capabilities but also criticizing it for producing hallucinatory code. The article also touches on other updates such as explicit building of Swift modules, EditorConfig support, as well as some legacy issue fixes and new compatibility issues that have arisen.
Chris Lawley’s In-Depth Interview About Smart Script and Math Notes
Chris Lawley engages in an in-depth conversation with Apple's Input Experience Engineering Manager Jenny Chen and System Experience Product Manager Ty Jordan, discussing two innovative features in iPadOS 18: Smart Script and Math Notes. Smart Script utilizes on-device machine learning to optimize the handwriting experience, making handwritten text comparable to typed text. Math Notes supports handwriting mathematical equations and instant calculations, also allowing for variable settings and chart creation. This interview not only discusses the technical principles and use cases of these features but also reveals details not covered in the WWDC keynote, showcasing significant advancements in iPadOS 18 in enhancing user efficiency and experience.
Mastering ScrollView in SwiftUI
Following last year's major update, Apple has again infused SwiftUI's ScrollView with a host of new features at WWDC 2024, further enhancing its capabilities. Majid Jabrayilov explores these new features in several articles, providing developers with a comprehensive guide. The articles cover key concepts such as Scroll Offset, Scroll Geometry, Scroll Phases, and Scroll Visibility, aiming to help developers fully master the new functionalities of ScrollView to create smoother and more interactive scrolling experiences in SwiftUI applications.
肘子的话
我的杭州 “冒险” 之旅
上周,我踏上了一趟前往杭州的 “冒险” 之旅。
今年四月在北京参加 Let's VisionOS 活动时,我注意到一个大男孩 Ryan Zhu 一直跟在活动组委会人员身边帮忙做些杂务。交流后我惊讶地得知,他今年才 17 岁,还在上高二。Ryan 特地从杭州赶来,除了参会外,还想学习一些主办经验。
不久后,我便看到了由 Ryan 和他的众多伙伴们一起筹备活动的消息——他们要举办一个针对 16-26 岁年轻人的黑客松活动,名为 AdventureX 2024|逃逸计划。在他们的官方网站上,这次活动被定义为中国第一个由学生和社区组织的面向年轻人的黑客松。通过 播客 采访,我了解到活动的组织者大多是学生,甚至相当一部分都是中学生。了解得越多,我越感好奇,同时也越发担心:这样一个团队真的能支撑起一个为期 5 天、数百人参与的活动吗?
在收到 Ryan 的邀请后,我欣然接受了做一场与 SwiftUI 相关的 workshop 的邀请,但这并没有完全打消我的疑虑。
然而,当我步入现场的那一刻,所有的担心都烟消云散了。看着眼前的一切,我不禁感慨:或许只有由年轻人主导、年轻人参与,才能最终营造出如此充满活力、创意四射的活动氛围。
活动是否成功,从每个参与者所展现出来的状态就能充分体会到。一个个全神贯注且激情满满的年轻面孔让我意识到,人生或许只有在这样的年纪才能如此忘我地投入到一场充满未知挑战的冒险中。
请关注 AdventureX 的社交账号,了解更多活动内容和未来活动的信息:
微信公众号 @AdventureX
即刻 @AdventureX
B 站 @AdventureX逃逸计划
小红书 @adventurex
让我们一起期待 AdventureX 2025!
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
使用 SwiftUI 开发无限四向滚动分页组件
SwiftUI 的出现为苹果生态的开发带来了革命性的变化,但在面对某些复杂需求时,它仍然存在一些挑战。最近,我开发了一个名为 Infinite4Pager 的组件,它支持无限四向滚动分页功能。本文中我们将分析实现过程中的关键思路,讨论需要特别注意的事项,并坦诚地审视 SwiftUI 在应对这类场景时的不足之处。通过这个案例,我们不仅能学习到具体的技术实现,还能更好地理解如何在 SwiftUI 的框架下突破常规,创造性地解决问题。
近期推荐
CrowdStrike 导致的系统崩溃原因分析
近日,网络安全公司 CrowdStrike 的一个技术失误引发了全球范围内的大规模系统崩溃事件,严重影响了多个国家的关键服务领域。
Zach Vorhies(前谷歌员工,曾披露谷歌“机器学习公平性”,一种审查并控制信息获取的人工智能系统)在其 推文 中分析了问题的根源。他指出,C++编程中的空指针错误和缺乏有效的质量控制是导致此次灾难的主要原因。Vorhies 建议采用 Rust 等现代编程语言来预防此类问题,并呼吁微软改进驱动程序的回滚策略,以系统层面预防单一驱动问题引发的全面崩溃。此事件突显了在开发高权限系统组件时对编程语言选择和质量控制的重要性。
Tavis Ormandy(谷歌漏洞研究员)对 Zach Vorhies 的观点提出了异议。他在 推文 中指出,问题并非空指针引起的,“这段代码在循环中从表中读取指针,而其中一些指针是无效的。这可能是由于解析配置文件时的错误,导致某些条目未被正确初始化。”
Swift 6
在 Swift 6 中,数据竞争安全特性本应助力开发者自动化地识别并解决难以追踪的并发问题,然而 Alex Grebenyuk 在文章中表达了对此的担忧和质疑。他指出,这一特性实际上把大量工作转移给了开发者,尤其是在启用 Swift 6 模式后,原先的警告将转变为编译错误,这可能导致处理大量代码库时面临数千个错误。因此,Alex 建议将并发错误处理为警告,并使这些警告可选,脱离 Swift 6 模式的强制性绑定,并支持持续的迭代改进,而非过早地确定设计方案。他还批评了 Swift 近年来在新特性开发方面的方向,质疑这些变化是否真正提升了开发效率。文章呼吁 Apple 应回归 Swift 的初衷——保持语言的简洁快速,专注于提升开发者的生产力,而非增加他们的工作负担。Alex 的分析反映了一部分资深 Swift 开发者对于语言未来发展的期望和顾虑。
一些有关 Xcode 16 的讨论
在这篇综述中,Michael Tsai 汇集了开发者社区对 WWDC 2024 推出的 Xcode 16 的多方面反馈。新版本带来了备受关注的 AI 驱动代码自动补全(Swift Assist)等创新功能,但也引发了一些争议。开发者们对 AI 功能的评价不一,既有赞赏其上下文感知能力的声音,也有批评其产生幻觉代码的意见。文章还涉及了显式构建 Swift 模块、EditorConfig 支持等其他更新,以及一些遗留问题的修复和新出现的兼容性问题。
iPadOS 18 手写与计算新功能深度解析🪜 ( Chris Lawley’s In-Depth Interview About Smart Script and Math Notes )
Chris Lawley 与苹果公司的输入体验工程经理 Jenny Chen 和系统体验产品经理 Ty Jordan 进行了深度对话,探讨 iPadOS 18 中的两大创新功能:Smart Script 和 Math Notes。Smart Script 运用设备端机器学习技术优化手写体验,使手写文本媲美打字文本。Math Notes 则支持手写数学方程并即时计算,还能设置变量和创建图表。这次采访不仅详细讨论了这些功能的技术原理和应用场景,还揭示了 WWDC 主题演讲中未涉及的细节,展现了 iPadOS 18 在提升用户效率和体验方面的重大进步。
Mastering ScrollView in SwiftUI
继去年的重大更新之后,苹果在 WWDC 2024 中再次为 SwiftUI 的 ScrollView 注入了大量新功能,进一步增强了其能力。Majid Jabrayilov 通过多篇文章探讨这些新增特性,为开发者提供全面的指南。文章涵盖 Scroll Offset、Scroll Geometry、Scroll Phases 和 Scroll Visibility 等关键概念,旨在帮助开发者全面掌握 ScrollView 的新功能,从而在 SwiftUI 应用中创造更加流畅和交互丰富的滚动体验。