Old Driver iOS Weekly #217 | 2022-09-19

Original link: https://github.com/SwiftOldDriver/iOS-Weekly/releases/tag/%23217

ios-weekly

The old driver iOS weekly report, only presents valuable information for you.

You can also contribute to this project. If you find valuable information, articles, tools, etc., you can submit it to us in Issues , and we will deal with it as soon as possible. Remember to write the reason for your recommendation. Suggestions and comments are also welcome to Issues .

article

? Xcode LLDB time-consuming monitoring statistics scheme of ByteDance DanceCC toolchain series

@關旍捔攵: In the article “Optimization of Swift Debugging Performance in ByteDance’s DanceCC Toolchain Series” , it introduces how to use a custom toolchain to optimize the performance of the debugger and solve the debugging pain points of large-scale Swift projects. In order to accurately measure the efficiency improvement of the optimized LLDB debugging Xcode project and measure the project revenue, it is necessary to develop a time-consuming monitoring solution that can obtain the debugging time of the Xcode official toolchain and the DanceCC toolchain at the same time. This article details a set of special solutions proposed by DanceCC. The principle of the solution is based on the LLDB Plugin, using Fishhook to intercept Xcode’s calls to LLDB from the Script Bridge API level of LLDB, so as to conduct time-consuming monitoring and statistics.

? This year, my thoughts on terminal organization and technical architecture [Experts talk about technology]

@Lianshu : Xianyu is an earlier attempt at Flutter business in China, and it is also an earlier app that fully embraces Flutter. In this article, Zong Xin, the technical director of Xianyu, shared his changes in the mobile development industry from the perspectives of software architecture and organizational form, and then proposed a possible future job division: application R&D engineer and infrastructure development Engineer, and released a set of Flutter-based UI development rendering engine KUN developed by Xianyu around such a job division. Mobile development has been in development for more than ten years now. Compared with the most open iOS/Android development, the R&D team has evolved into a more complex form. This article is a relatively good summary of these trends and its own technology stack. Students who feel confused can also take a look.

?Exploration of dynamic list scheme based on React Native

@Damien : You must be familiar with dynamic rendering frameworks. For example, Ali’s DinamicX and Tangram should be familiar to everyone. Although DSL-based dynamic solutions have some performance advantages, they are not Turing-complete after all, and some require dynamic logic. The delivery requirements are expensive to implement, and the NetEase Cloud Music team brought their best practices, a dynamic list solution based on React Native. Simply put, the ReactNative container is embedded in the ViewHolder of RecyclerView. The main frame of the page is still developed and rendered by Native, the loading speed of the first screen is guaranteed, and the partial RN implementation also makes the page dynamic. Interested students may wish to read it.

? The ultimate C++ pit avoidance guide

@xuyafei : C++ is an old language, but it’s still being updated constantly, citing new features. But at the same time, C++ cannot get rid of the huge historical burden, and the original design and concept of C++ have made C++ extremely complicated, and there are many unreasonable “defects”. This article has 3 main purposes:

  1. Summarize some obscure grammar phenomena in C++, explain the reasons behind them, and use them as a way to prevent stepping on pits
  2. Compare with some other programming languages ​​and list their pros and cons
  3. Post some of my own views and feelings as a C++ programmer

? How to judge whether ScrollView and List are scrolling

@Laofeng : SwiftUI does not provide an API for this. This article will describe several ways to get the current scroll state in SwiftUI, each with their own advantages and limitations.

  1. Introspect: By accessing the UIKit controls behind the Delegate; the advantages are accurate, timely, and the system burden is small; the disadvantages are poor backward compatibility.
  2. Runloop: Create a TimerPublisher bound to different Runloop modes to judge the scrolling state; the advantages are simple, accurate, and timely; the disadvantage is that it only supports iOS, and there can only be one scrollable control on the screen.
  3. PreferenceKey: Subviews can pass information to their ancestor views through the preference view decorator; the advantage is that it supports multiple platforms, and is backward and forward compatible;

In addition, the author wrote the IsScrolling open source library for the above scheme, and students who need it can refer to it.

? Do you really understand iOS exception capture?

@BenBen : We will definitely encounter exception capture in our development. The author of this article analyzes it from the operating system level. When an exception is triggered, the application is switched from user mode to kernel mode for processing. As introduced in the article, exceptions are divided into two categories: 1. Hardware exceptions, 2. Software exceptions. When an exception is triggered, a Mach Message containing the exception information will be passed to the registered port through the Match Exception mechanism to be processed. If Mach Exception is not handled in tread and task, it will be turned into Unix Signal signal. So what needs to be done is to catch Mach Exception and Unix Singal, the specific code is described in the article. If you want to know more, please read the article in detail, and you can refer to some open source CrashReport libraries.

? Clip control on the Apple GPU

@AidenRao : Apple’s latest line of Macs include their in-house “M1” SoC with a custom GPU and neither public documentation nor open source drivers. Apple’s Metal for App Store developers has only a limited API and lacks support for OpenGL functions. The author of the article provides a variety of solutions to support OpenGL’s clip control, and finally realize the game Neverball running on Mac OS.

? User experience optimization on the special effect side – package volume

@JonyFang : After understanding the basic package volume composition of special effects, you can adjust the compilation options and code in a targeted manner to optimize the package volume. At the same time, it introduces the package volume monitoring tool, which outputs the size of the package volume increase and the reasons for the increase of the package volume caused by each demand, timely gives the package volume alarm, locates abnormal increment cases, slows down the package volume growth, and promotes business optimization.

? What’s the “any” keyword? Understanding Type Erasure in Swift

@xiangerxiansen : Swift’s strong typing is the cornerstone of program robustness. But in the past, strong typing brought some unnecessary evasion work to developers in some special scenarios. The any keyword introduced in Swift 5.7 solved this problem very well. This article explains the concept of type erasure, and how has it been done in the past? What’s the difference after any ? It is recommended to read in conjunction with Existential any in Swift explained with code examples .

? iPhone 14 Screen Sizes

@Barney : This article mainly introduces a review of the screen size changes of the iPhone 14 in 2022, with simple and easy-to-understand sample images, which are clear at a glance.

tool

Regex101, online tool for regular debugging

@anotheren : Regex101 is an online tool for regular debugging. It provides a lot of help information to optimize regular writing, and even provides Code Generator to directly generate code in related languages ​​(supports Swift). Not only is it convenient for novices, if you also deal with regular expressions often, you can try this tool.

Moyu Weekly

@Moyu Weekly#68 : The 68th issue of Moyu Weekly is here, let’s take a look at the summary of this issue:

  • Topic of this issue: iPhone14 Smart Island Creative Prospects
  • This week’s learning: __covariant and __contravariant in Objective-C generics
  • Content recommendation: Compilation and hot reloading excellent article recommendation
  • Touch the fish: Recommended tools for iOS development internationalization

Follow us

We are “Old Driver Technology Weekly”, a technical public account that continues to pursue high-quality iOS content. Welcome to pay attention.

Follow Youli, pay attention to [Old Driver Technology Weekly], reply to “2021”, and receive 2017/2018/2019/2020 internal reference

Also supports RSS feeds: https://github.com/SwiftOldDriver/iOS-Weekly/releases.atom .

illustrate

? means a tool is needed, ? means editor’s recommendation

Estimated reading time: ? Read quickly (1 – 10 mins); ? Moderate (10 – 20 mins); ? Slow (20+ mins)

This article is reprinted from: https://github.com/SwiftOldDriver/iOS-Weekly/releases/tag/%23217
This site is for inclusion only, and the copyright belongs to the original author.