Old Driver iOS Weekly #212 | 2022-08-08

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

Old Driver iOS Weekly #212 | 2022-08-08

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 .

“WWDC22 Internal Reference”

A total of 12 articles were updated last week, and a total of 86 articles have been updated so far, each of which is of very high quality. Due to space problems, I recommend 3 articles at the beginning that may be more interesting to everyone, and the others are put at the end of the weekly report~

? 【WWDC22 110352/110353】Embrace Swift Generics

This article focuses on the new language features about generics in Swift 5.7. Through a sample program, I will discuss the usage scenarios of generics and the interface design of protocols, and help you understand the use of some and any modifiers in generics.

? 【WWDC22 10068】UIKit New Features

As a very core framework in the iOS development process, UIKit will make some upgrades and adjustments to it every year. It’s just that in the past, more independent sessions were created for individual changes, and there was no dedicated session to systematically introduce changes in UIKit. Since WWDC 2021, What’s new in UIKit has been systematically introduced for the first time. The main aspects include changes to improve productivity, UI changes and API changes. This year, following the ideas of last year, we will continue to introduce these aspects. Although there is no way to introduce all the technical details of UIKit changes in this session, it will summarize the most important parts of UIKit’s new features and play an outline role, so that everyone can have an overall understanding of UIKit’s changes. The article will include some session links and Apple’s official documents, so that readers can understand the details of its further changes.

? [WWDC22 10136/10137/110340/110342] Swift Charts Implementation of Efficient Charts and High-Quality Chart Design Elements

This article will implement simple to complex charts based on various examples and the Swift Charts API; at the same time, learn about the design experience elements of some high-quality charts; I believe that it will provide some help and guidance for chart drawing by planning to apply SwiftUI in the desktop widget scene.

article

Switching between SwiftUI’s HStack and VStack

@zvving : HStack and VStack are the basic layout tools of SwiftUI. When it comes to switching between horizontal and vertical screens, we also expect the layout to be dynamically converted between HStack and VStack .

GeometryReader seems to be one of the feasible solutions: choosing the layout method by calculating the width and height of the container, but it also brings layout details and animation problems (when switching between horizontal and vertical screens). This article describes how to use Size classes and AnyLayout and ViewThatFits introduced by AnyLayout to better solve similar problems.

? Develop a JavaScript runtime with deno_core

@Smalfly : This article describes how to create a custom JavaScript runtime, runjs, which can be approximated as a light version of Deno. The goal is to develop a command line program that executes local JavaScript files, can read files, write files, delete files, and a console API.

? tcmalloc source code analysis

@xuyafei : tcmalloc is a memory allocator developed by Google, which is used in Golang and Chrome for memory allocation. It effectively optimizes the problems existing in ptmalloc, of course, it also pays some costs. If you are interested, you can read the original text to understand the specific implementation of tcmalloc.

? ? A hybrid MP4 solution that supports dynamic insertion of business elements – YYEVA

@JonyFang : This article mainly introduces the overall framework of YYEVA. YYEVA is a MP4 solution launched by YY that supports dynamic elements, including AE plug-ins, online preview tools, and rendering SDK (supports iOS, Android, and Web). YYEVA open source is attached at the end of the article. the address of. Some documents related to the YYEVA framework are introduced:

?One article to understand ByteDance’s “Buried Point Verification Platform”

@Barney : This article mainly introduces ByteDance’s buried point verification platform from a macro perspective. From multiple roles, multiple nodes, and multiple aspects, the quality of buried points is fully guaranteed, which is worth learning.

The introduction is roughly divided into:

  • Buried point verification process
  • Technical Architecture Overview
  • Product Process Overview
  • Technical challenges and resulting benefits

? Solve the iOS memory crash caused by Flutter

@CrazyCoderShi : The current mainstream version of Flutter has a memory problem on the iOS platform, but it is not easy to solve. This article uses two solutions to help readers solve the problem. At the same time, the operation process of the nanny-level magic modification Flutter Engine is provided. Xiaobian reminds ⚠️ : This solution is not recommended for novice users to try.

? iOS 16 UIView/UIViewController new changes

@ChengzhiHuang : A new exception was found recently when adapting to iOS 16: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application circumvented Objective-C runtime dealloc initiation for <UIViewController> object.'

After research by pudge62 , UIViewController in iOS 16 has an additional method called _objc_initiateDealloc . The internal code is used to ensure that the VC is released on the main thread. The call chain is:

release -> -[UIViewController _objc_initiateDealloc] -> dispatch_async(_objc_deallocOnMainThreadHelper) -> -[UIViewController dealloc]

The previous system also had this mechanism, and it seems that iOS 16 changed the way of implementation. The name _objc_initiateDealloc to be closely related to dealloc initiation in the exception.

Specific reason: There is code in the project that overrides the +initialize method of UIViewController, which will cause _class_setCustomDeallocInitiation([UIViewController class]) not to be called, and eventually crash.

Solution: Since the system UIView/UIViewController has the initialize method, it is recommended that you do not override the +initialize method of UIViewController; if you must override the +initialize method, then find a way to call the official one first, and then call your own +initialize method (not recommended).

This specific analysis and solution is provided by pudge62

? Alibaba’s cross-end technology evolution

@kemchenj : Alibaba’s Qianniu team brought us the sharing of cross-end technology evolution. There are three articles in this series:

  • Cross-end SDK technology evolution : Along with the industry’s cross-platform technology development and evolution, the Qianniu team has also accumulated a set of C++-based cross-platform technology systems. This article will take the message SDK as an example to describe this technology evolution process in detail.
  • Cross-desktop web container evolution : From the evolution of container architecture, container function enhancement and stability assurance and future evolution, these three aspects will introduce how Qianniu’s applications can interface with browsers.
  • Cross-desktop componentization practice : It mainly introduces the thinking, solution selection, some problems encountered and solutions in the cross-end framework of Qianniu PC.

iOS 16 Live Activity

@xiangerxiansen : WWDC22 Keynote introduces a brighter update in iOS 16: Live Activity. Developers can place a widget that can be updated in “real time” on the lock screen page, such as a takeaway or taxi app, and enable Live After the Activity, you can see the distance between the delivery boy/driver and us and the estimated time of arrival in real time on the lock screen page.

This API and corresponding functions were finally released together with iOS 16 Beta4, but Apple made it clear that it will not be released with the official version of iOS 16.0, but will be released later this year, and the specific time has not been given.

This article introduces the adaptation and precautions of iOS 16 Live Activity, and also shares the development/use experience. At the end of the article, a Demo is provided for your reference, which can be read in association with Experimenting with Live Activities .

WWDC22 internal reference update

? 【WWDC22 10058 & 110343】SwiftUI on iPad

This article is based on the content of the two sessions 10058 and 110343, and takes the official Places App as an example to introduce the new features of SwiftUI on iPadOS 16.

? 【WWDC22 10142】 Manage background tasks more elegantly through concurrent programming

This session combines scenarios and cases to explain how to manage asynchronous background task execution processes in a better way based on SwiftUI and Swift concurrency features, and introduces the background mode of URLSession to explain background tasks in a more realistic way principles and rules.

? 【WWDC22 10066/10101/10104】 Explore Metal3

Metal is Apple’s efficient, low-cost graphics computing API. It’s designed to drive the powerful GPUs behind Apple products in the fastest, most efficient way possible. This article introduces Metal 3’s powerful new features, including fast asset loading, offline compilation, MetalFX, Mesh Shaders, ray tracing pipelines, machine learning support, and more.

? 【WWDC22 10079】Improve DNS security for applications and servers

The purpose of this article is to explore state-of-the-art approaches to ensuring the secure use of DNS in applications. It first introduces why DNS is insecure, and how to protect its security through DNSSEC and DNS using DDR encryption.

? [WWDC22 10032] Implement Shortcuts with a new framework

Use the new framework AppIntents to extend the functionality of your app to support Siri and Shortcuts apps.

? 【WWDC22 110367】Use Concept to simplify C++ templates

This session mainly introduces concept, a representative new feature in C++20 that is newly supported on Xcode14, and starts from practical examples, using concept to simplify the template code of C++, and finally introduces the calculation method at compile time. constexpr attribute.

? 【WWDC22 10016】Extend your App with CarPlay

This article mainly introduces the new features of Carplay in iOS 16, including four parts: The first part is the explanation of Carplay’s UI rendering method – template. The second part introduces two new application types and some corresponding applications. The third part is to explain the use of a new Caplay test method. Finally, it introduces how Carplay is linked to the dashboard of the car.

? 【WWDC22 10128】Using real objects to build AR scenes

From the real object at hand (and the idea of ​​AR in your mind) to an interesting AR App, what process do you need to go through? This session may give the answer. This article reviews Object Capture, introduces new APIs that ARKit camera enhancements can be used with, and uses an AR chess game as an example to demonstrate the basic workflow from acquiring 3D models of real-world objects to building AR applications.

Moyu Weekly

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

  • Topic in this issue: Apple Entrepreneur Training Camp is open for applications
  • Learning of the Week: Sequence in Swift
  • Recommended content: WWDC22 & SwiftUI good article recommendation
  • Touch the fish: Win11 online experience implemented by React, simulating websites for Windows and x86 systems

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/%23212
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment