中文位于文章的下半部分
Weekly Comment
Welcome readers to the brand new year of 2024! First of all, I sincerely wish each and every one of you a happy new year, filled with happiness and success.
Looking back at 2023, I have briefly summarized my achievements in writing. In that year, I wrote a total of 34 blog posts, covering a diverse range of topics.
Among the articles I published in 2023, the top five most popular ones among English readers were (according to Medium's statistics):
For Chinese readers, the five most popular articles are (Blog + Juejin + Zhihu + WeChat):
Customizing the Appearance and Interaction Behavior of Buttons
Cracking the Code: The Mysterious @State Injection Mechanism
And the five articles that I put the most effort into in 2023 are:
Starting from 2024, all my articles (including both Chinese and English versions) will only be published on my blog (Medium will stop updating on April 1st). I hope that in the new year, I will be able to create more high-quality content, not only sharing knowledge but also continuously improving myself in the process. Once again, thank you for the support of all readers, and I look forward to continuing our journey together in the future!
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
Blog Update Chronicle: Welcoming 2024 with a New Blog
Over a month ago, I embarked on a bold plan: to completely reshape my blog site with the assistance of artificial intelligence. Finally, as we approach the end of 2023, this brand new version of the blog has come to life. This article will briefly review the journey of this blog update, documenting the key steps and personal insights along the way.
Recent Selections
Swift C++ Interop
Swift 5.9 introduces bidirectional interoperability support between Swift and C++. This advancement allows the generation of C++ header files, enabling the exposure of Swift APIs in a C++ interface-like manner. It greatly simplifies the process of integrating Swift into existing C++ code, which has been a key development focus for the Swift team in recent years.
In this article, zonble shares his experience and insights in attempting to merge Swift and C++ in practical work. He points out that although Swift C++ interoperability is feasible to some extent, it is currently not mature enough to be fully applied in practical work. It may still be necessary to utilize Objective-C as an intermediate layer before Swift fully supports C++.
AsyncPhoto for displaying large photos in SwiftUI
Although SwiftUI has provided the AsyncImage view since iOS 15, the limitations of its functionality and flexibility still drive developers to seek additional third-party solutions for better image retrieval and display. To address this challenge, Toomas Vahter introduces his custom AsyncPhoto view for SwiftUI in his two-part article. This solution is designed specifically for displaying large photos and offers a wider range of flexibility, supporting image loading from various data sources and allowing for custom image processing and display. The introduction of AsyncPhoto provides an efficient and flexible new option for image display in SwiftUI.
Interesting Facts About Apple iOS App Distribution and Installation
This article mainly introduces some interesting things and historical evolution in the distribution and installation process of Apple iOS applications. iHTCboy talks in detail about how Apple has developed its application distribution ecosystem, from the period when Apple initially launched iPhoneOS without support for native app development to the later introduction of the App Store. The article explores different developer programs and distribution methods, such as enterprise signing, super signing, TestFlight signing, and MDM super signing, as well as developer mode, enterprise accounts, and device registration restrictions. Additionally, the article also covers solutions for distributing custom and non-public apps, and discusses the potential impact of the EU's Digital Markets Act on Apple's software ecosystem. The article provides readers with a comprehensive and in-depth understanding of the distribution and installation process of Apple iOS applications.
Comparing Swift Compiler Performance on Type Inference Part I
In this article, Lucas van Dongen explores the performance of the Swift compiler in terms of type inference, with a particular focus on the impact of different initialization methods on compilation speed. The article begins with a challenge the author faced in his work: a code block in the application he was responsible for maintaining exceeded the 1000 millisecond limit for compilation time, resulting in failed continuous integration (CI). He discovered that the problem stemmed from the use of .init()
in the code, which significantly slowed down the compilation speed. The article thoroughly analyzes the specific impact of different initialization methods for various types (such as strings, numbers, arrays, and dictionaries) on the performance of the Swift compiler. Additionally, the author shares a series of benchmark tests to demonstrate the performance comparison of different versions of the Swift compiler.
The Journey of Investigating the Loss of Swift Runtime Symbols in Dynamic Libraries
DanceCC is the brand name of a compilation toolchain for ByteDance's Mobile Infra, based on Swift.org's toolchain. It includes customized debugging optimization, custom Clang plugin features, and self-developed passes for package size and performance optimization, among other things.
This text starts with a specific technical problem: after adopting the latest toolchain from DanceCC, an application crashes upon startup. The author, DreamPiggy, accurately identifies the core issue through in-depth technical analysis – the loss of critical symbols from the Swift Runtime in the dynamic link library. The article thoroughly documents the author's troubleshooting steps, particularly the meticulous examination of the visibility attributes of the compiler-generated symbols. After a deep analysis of the problem, DreamPiggy proposes a temporary solution and further shares methods for a profound fix, including modifying the source code to ensure the correct visibility of symbols.
肘子的话
欢迎各位读者进入崭新的 2024 年!首先,衷心祝愿每位读者新年快乐,愿这一年对您来说充满幸福和成功。
回顾 2023 年,我对自己的创作成就进行了简要总结。在这一年里,我共撰写了 34 篇博文,涵盖了多样化的主题。
在我 2023 年所发布的文章中,吸引英文读者最多的五篇博文包括( 根据 Medium 的统计):
对于中文读者而言,最受欢迎的五篇文章则是( 博客 + 掘金 + 知乎 + 微信 ):
而我在 2023 年投入最多精力的五篇作品则是:
从 2024 年开始,我所有的文章(包括中英文版本)将只在我的博客上发布。希望在新的一年里,我能够创作出更多优质内容,不仅分享知识,同时也在这个过程中不断提升自己。再次感谢各位读者的支持,期待我们在未来的日子里继续同行!
如果您发现这份周报或我的博客对您有所帮助,可以考虑通过 爱发电,Buy Me a Coffee 支持我的创作。
原创
博客更新记:用新博客迎接 2024
一个多月前,我启动了一个大胆的计划:在人工智能的协助下,彻底重塑我的博客站点。终于,即将度过 2023 年之际,这个全新的博客版本终于面世。这篇文章将简要回顾这次博客更新的旅程,记录下其中的关键步骤和个人感悟。
近期推荐
Swift C++ Interop
Swift 5.9 引入了 Swift 与 C++ 之间的双向互操作性支持。这一进展通过生成 C++ 头文件,允许以类似 C++ 接口的形式暴露 Swift API,极大地简化了将 Swift 集成到现有 C++ 代码中的过程。这也是 Swift 团队近年来的重点开发方向。在这篇文章中,zonble 分享了他在实际工作中尝试融合 Swift 和 C++ 的经验和感悟。他指出,虽然 Swift C++ 互操作性在一定程度上是可行的,但目前还不够成熟,无法完全应用于实际工作中。在 Swift 完全支持 C++ 之前,可能还需要通过 Objective-C 作为中间层。
AsyncPhoto for displaying large photos in SwiftUI
虽然自 iOS 15 起 SwiftUI 已提供 AsyncImage 视图,但其功能和灵活性的局限性仍驱使开发者寻求额外的第三方解决方案以更好地获取和展示图像。针对这一挑战,Toomas Vahter 在其文章中( 共两篇)介绍了他为 SwiftUI 定制的 AsyncPhoto 视图。这一解决方案专为展示大型照片而设计,提供了更广泛的灵活性,支持从多样化的数据源加载图像,同时允许进行自定义的图像处理和展示。AsyncPhoto 的推出,为 SwiftUI 中的图像展示提供了一个高效、灵活的新选项。
苹果 iOS 分发和安装 App 的那些趣事
iHTCboy (37 手游移动客户端团队)
这篇文章主要介绍了苹果 iOS 应用的分发和安装过程中的一些有趣的事情和历史演变。iHTCboy 从苹果最初推出 iPhoneOS 时期不支持原生应用开发,到后来推出 App Store 应用商店的转变,详细讲述了苹果如何发展其应用分发生态系统。文章探讨了不同的开发者计划和分发方式,如企业签名、超级签名、TestFlight 签名和 MDM 超级签名,以及开发者模式、企业账号、设备注册限制等方面。此外,文章还涉及了自定 App 和非公开 App 分发的解决方案,并讨论了欧盟的《数字市场法》可能对苹果软件生态造成的影响。文章为读者提供了关于苹果 iOS 应用分发和安装过程的全面而深入的了解。
Comparing Swift Compiler Performance on Type Inference Part I
在这篇文章中,Lucas van Dongen 深入探讨了 Swift 编译器在类型推断方面的性能,尤其聚焦于不同初始化方法对编译速度的影响。文章起始于作者在工作中遭遇的一个挑战:他负责维护的应用程序中某个代码块编译时间超出了 1000 毫秒的限制,导致持续集成(CI)失败。他发现,问题源于代码中 .init()
的使用,这显著拖慢了编译速度。文章详尽地分析了在 Swift 中不同类型(如字符串、数字、数组、字典)的初始化方式对编译器性能的具体影响。此外,作者还分享了一系列基准测试,展示了不同版本 Swift 编译器性能的比较。
Swift Runtime 符号在动态链接库丢失的排查之路
DanceCC 是字节 ( ByteDance) Mobile Infra 的一套编译工具链的品牌名,基于 Swift. org 的工具链进行了相关定制,包括调试优化,定制 Clang 插件特性,自研 Pass 做包大小和性能优化等等。
本文以一个具体的技术难题为起点:在采用 DanceCC 最新工具链后,某应用程序在启动时遭遇崩溃。作者 DreamPiggy 通过深入的技术分析,准确地锁定了问题的核心——Swift Runtime 的关键符号在动态链接库中的丢失。文章详细地记录了作者在问题排查过程中的各个步骤,特别是对编译器生成的符号的可见性属性进行了细致的审查。在深入剖析问题之后,DreamPiggy 提出了一个临时的解决方案,并进一步分享了对问题的深层次修正方法,包括对源代码的修改以确保符号的正确可见性。
Hi,
感謝肘子大精彩的文章和整理!
但今天想回顧時發現大部分的內文文章連結都失效了,
請問有沒有辦法將他們修復一下 🙏