Old Driver iOS Weekly #248 | 2023-06-12

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

ios-weekly

The old driver’s 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 them to us in Issues , and we will deal with them as soon as possible. Remember to write down the reason for the recommendation. Suggestions and comments are also welcome to Issues .

news

? U4 5.0 kernel officially released

@莲友: UC is one of the few teams in China that continuously invests in deeply customizing the Chromium kernel. It recently released the U4 5.0 version, which has greatly improved compared to the Chromium 100 version in terms of performance, stability and function coverage. At the same time, the article shares the specific work of the new version from the aspects of rendering architecture, JS engine, general capabilities and basic experience. It is recommended to read for students who are interested in browser kernel optimization.

? There are so many cool new features in Swift and Xcode

@AidenRao : The author of the article installed Xcode 15 for the first time, and shared the cool new features he found:

  • When using conditional compilation, code that does not match the current environment will be automatically grayed out by Xcode.
  • Can add bookmarks to code
  • #Preview now also supports UIKit and AppKit
  • Support for Swift macros

article

?? Look at Swift’s method dispatch through SIL

@JonyFang : Between the Swift language and LLVM IR, SIL is added to swiftc. Through SIL, Swift can be further optimized. SIL is easier to read than assembly. We use it as a tool to understand and learn the method dispatch mechanism of the Swift language. Problems encountered during coding are also explained with the help of SIL. The content of this article mainly introduces the part about method invocation in SIL:

  1. Introduction to SILs
  2. Generate SIL
    • Declarations and Definitions
    • code block
    • function table
  3. Swift method dispatch
    • direct dispatch
    • function table dispatch
    • message distribution
  4. Solving several scene problems
    • Scenario 1: Protocol Extension
    • Scenario 2: The parent class does not implement the protocol method
    • Scenario 3: OC mix

?? Mobile APP component architecture practice

@Cooper Chen : This article is the experience and thinking of JD’s development students on the practice of componentization in medium and large-scale App projects. At the same time, it discusses some problems in the process of componentization. This article introduces the development architecture of componentization through the following questions Thoughts and some frequently asked questions:

  • Why componentization is needed
  • Challenges and choices encountered in the componentization process
  • How to maintain a high-quality componentized project

It can provide good experience sharing for teams with componentized engineering architecture requirements.

? iOS 17: Notable UIKit Additions | Swiftobjective-C

@Barney : This post discusses what’s new and changed in UIKit in iOS 17. The following new features are mainly introduced:

  • Unavailable Content is used to implement empty data views.
  • Preview Syntax enables new Swift macros to support UIKit’s Xcode preview.
  • Automatic Label Vibrancy provides labels to automatically support dynamic effects.
  • Symbol Animations lets SF Symbols animate buttons and images, adds multiple font styles, and a new text content type for enhanced autofill.

? Exploration on Performance Optimization of Mobile Browsers

@莲友: Now more and more businesses on the mobile side will use the app embedded webview, and then the front end will carry it through H5 technology. Obviously, limited by the performance of mobile devices, there is a difference between writing H5 code on mobile and traditional PC-oriented H5. This article mainly introduces the performance issues that need to be paid attention to when writing H5 code on mobile. The article first analyzes the reasons for H5 page freezes from the principle of rendering, and then puts forward the indicators to measure the freezes, and then analyzes the potential optimization direction based on the operating principle of the browser, and recommends client students who deal with H5 more and Front-end students read.

? Automatically convert the image and color of the asset into type attributes of ImageResource and ColorResource — new features in Xcode 15

@zoeGuo : Xcode 15 can generate pictures and colors in a more convenient way. Simply speaking, the usual way we used to use pictures is: UIImage(named: "peter") , in Xcode 15 we can use it directly like this: UIImage(resource: .peter) . After setting Generate Swift Asset Symbol Extensions to YES in Build Settings, Xcode will automatically turn the image and color of Asset into properties of ImageResource and ColorResource. This new capability supports both SwiftUI and UIKit, and supports older iOS versions! The author also introduces some naming rules for the generated attributes: it is named with a camel case starting with a lowercase letter; if color/image appears in the name we define, color/image will be removed from the generated attribute name; do not start with a number, otherwise it will be generated Attributes will be underlined. (Original reference link: Xcode 15 Release Notes )

? Use #Preview macro to define preview screen

@水水: Starting from Xcode15, it has become more convenient to add preview to the screen. It has the following three major improvements:

  • The preview program has become more streamlined, use #Preview { } to define the preview, the old version is more verbose
  • SwiftUI’s view and UIKit’s view and view controller can quickly add preview
  • It is convenient to preview what the widget looks like at different time points

This article lists the specific usage methods and examples of the three points of appeal in detail. Interested friends can read or practice~

? Demystifying SwiftUI Animation: A Comprehensive Guide

@Damien : SwiftUI uses a declarative syntax to describe UI presentation in different states, including animations. This article gives a comprehensive introduction to SwiftUI’s animation mechanism and provides a lot of demo code. In a nutshell, there are several conclusions about SwiftUI animations as follows:

  • An animation is a smooth transition from one state to another.
  • Declaring an animation requires three elements: a timing curve algorithm function, a declaration that associates a state (specific dependencies) with a timing curve function, an animatable component that depends on the state (specific dependencies)
  • Grasp the result of the state change.
  • The more precise the timing function is in relation to its dependencies, the less likely it is to produce erratic animations.
  • Unique and stable view identifiers (structural or explicit) help avoid animation exceptions.

? Use Swift Macros to Initialize a Structure

@Smalfly : This article mainly introduces how to use Swift macros in Swift 5.9 and Xcode to automatically generate initialization code for Swift structures. Shows how to create, name, implement, and debug Swift macros in Xcode, which is very helpful for practical applications.

It should be noted that although this feature is powerful, it should be used in moderation, and excessive use of macros can make the code difficult to understand and maintain. Overall, Swift macros are a useful and powerful tool for Swift developers.

For more Swift macro content, please refer to WWDC 23 Write Swift macros .

Moyu Weekly

@探鱼周报#96 : The 96th issue of Moyu Weekly is here, let’s take a look at the summary of this issue:

  • Topic of this issue: Vision Pro has opened the door to spatial computing
  • Recommended content: WWDC-related blog posts about new devices, new frameworks, and new features
  • Touch the fish: SummarAI, an AI plug-in that can summarize WWDC videos; see the changes from WWDC22 to WWDC23 from the Session title; Learn about visionOS; the minority course “Please add me as an Apple developer after 100 hours”

Introduce

Restarted to update the “iOS Reliable Internal Recommendation Topic”, and sorted out the positions that have been clearly recruited recently for your reference

  • [Hangzhou] Taobao – terminal platform – iOS/Android/C++
  • [Shanghai] flomo – Recruiting iOS developers
  • [Beijing] TikTok – Recruiting iOS Developers
  • [Shenzhen/Guangzhou/Beijing/Sanya] Bytedance – Clipping – iOS / Android / PC / Web / C++ Engineer / Algorithm
  • [Shanghai/Shenzhen] SHEIN – iOS/Android Development Team Introduction

For specific information, please go to: https://www.yuque.com/ioalliance/article/bhutav to view (if you have any recruitment needs, please contact iTDriverr)

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 politely, pay attention to [Old Driver Technology Weekly], reply to “2021”, and receive 2017/2018/2019/2020 internal reference

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

illustrate

? Indicates that a tool is needed, ? Indicates editor’s recommendation

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

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