Old Driver iOS Weekly #219 | 2022-10-17

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

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 .

 Developer – Design Development Accelerator

Apple launches Ask Apple for developers

Ask Apple

Apple announces Ask Apple , a new series of interactive Q&A and one-on-one consultations (Office Hour), giving developers more opportunities to connect directly with Apple experts for insight, support and feedback.

Developers need to join the Developer program and download Slack to participate in the exchange and interaction (similar to the Digital Lounges mode of WWDC22, the students who participated at that time should have a fresh memory of the rich information in the discussion). Everyone is welcome to sign up for Q & A discussions on a large number of topics , such as Smart Island, SwiftUI, experience optimization for new platforms and hardware, etc.

At the same time, there will be a special Office Hour session for Chinese developers (4 sessions in total), and the time has also fully taken into account the domestic developers.

  • Consulting and Design Evangelistic Team (Greater China)
    • October 21st 10:00am – 12:00am
    • October 21st 14:00 – 16:00 PM
  • Consulting Technology Evangelistic Team (Greater China)
    • October 21st 10:00am – 12:00am
    • October 21st 14:00 – 16:00 PM

Recommended for beginners

? Dynamic Island (and Live Activities): Quick start tutorial

@Speedboy : Apple is in

Xcode 14.1 Beta brings the related APIs of Smart Island. This article mainly introduces how to simply use the new Live Activities API to create your own Smart Island.

article

? How the CPU interacts with memory

@ Laodong : In the first half of this year, the actual performance of M1 Pro/Max/Ultra on GPU did not meet expectations, which led to further exploration of M1 series chips by many people. Later, the problem of insufficient TLB capacity was also discovered. So what is TLB? How does the CPU map memory? This article starts from today’s mainstream CPU architecture and explains how today’s CPUs manage and use L1/2/3 cache and memory.

? Apple’s use of Swift and SwiftUI in iOS 16

@關旍捔揃: iOS 16 has just been released, this article analyzes the proportion of Apple’s built-in applications using Objective-C, Swift, SwiftUI, and C and C++. By comparing the various systems from iPhone OS 1 to iOS 16, some conclusions can be drawn:

  • Objective-C is the core of iOS and is used directly or indirectly by most applications
  • The use of Swift has grown rapidly in past iOS releases. Swift finally surpasses C++ this year
  • Stable use of C++ over the years
  • SwiftUI is starting to gain traction, which is a good sign
  • C is slowly but surely disappearing

? This article lets you sort out PrimaryScrollController

@CrazyCoderShi : For Apple users, everyone basically knows that iOS mobile applications have a relatively common function: click on the status bar, the list will scroll to the top. However, this feature is not included in various list components of Flutter , this article teaches you how to use PrimaryScrollController to achieve this feature.

Where View.task gets its main-actor isolation from

@Damien : Swift 5.5 introduced the async/await feature, and Apple also added the task view decorator to SwiftUI to make it easier for developers to use async/await-based asynchronous code in views, but you know how tasks get their own execution. thread? And how does it relate to the MainActor modifier? If you are interested, please read it.

? Xcode 14.0 generates wrong concurrency code for macOS targets

@Cooper : Mac developers may experience concurrency bugs when building projects with Xcode 14.0 and 14.0.1 because the Swift 5.7 compiler generates invalid code when targeting the macOS 12.3 SDK. The solution was to build the project with Xcode 13.4.1 before Xcode 14.1 was released. The reason for the error is as follows:

  • Swift 5.7 compiler has different executor hops than Swift 5.6 due to the implementation of SE-0338
  • Swift 5.7 adds an unofficial attribute @_unsafeInheritExecutor to annotate some standard library functions that need to exit the new rules. When the compiler compiles to this attribute, it will generate different executor hops
  • The reason for the compilation error is that in Mac development, Xcode14 uses the Swift 5.7 compiler and the Swift 5.6 standard library, which does not contain the @_unsafeInheritExecutor attribute
  • This problem will be fixed when Xcode 14.1 and macOS 13 SDK are released

? Full-link burying solution based on self-built VTree

@Barney : This article introduces in detail a set of full-link buried point solutions developed by the NetEase Cloud Music technical team, from buried point design, to client three-terminal ( iOS , Android , H5 ) development, and buried point verification & inspection , and then use the buried point data. From the design to the thinking behind it and the online practice, there are detailed instructions, which are suitable for careful reading and thinking.

? Virtual Memory & I/O & Zero Copy

@ Laofeng : Memory management is also one of the core functions of the operating system. This article mainly explains the memory management technology under the Linux system. It is a good popular science article, which mainly includes the following four parts:

  • Virtual Memory: Address Translation, Caching, Accelerated Translation & Optimized Page Tables
  • Kernel Space & User Space: Kernel Mode and User Mode
  • IO: (synchronous) blocking IO, (synchronous) non-blocking IO, IO multiplexing, network IO model, asynchronous IO
  • Zero copy: traditional IO process, mmap + write, copy-on-write

tool

? wise words – a markdown note-taking application more suitable for engineers

@水水: A simple and beautiful open source Mac Markdown editor without any extra features. Developed with native Swift, lightweight and high performance, safe and pure local use, with syntax highlighting, dark mode, automatic formatting, separate editing, presentation mode, image bed and other functions. It can also be used as a memo and archive, which I personally prefer.

code

Semaphore

@Smalfly : Semaphore is a semaphore management class. The difference between it and DispatchSemaphore is that it does not block threads, but provides more fine-grained resource management capabilities under the Swift Concurrency framework, such as support for suspending and resuming Tasks.

Reactive Programming Demo – RxStudy, GetXStudy

@JonyFang : RxStudy and GetXStudy are demos based on RxSwift/RxCocoa and GetX frameworks respectively. You can combine the two projects to compare programming ideas.

package-benchmark

@xuyafei : package-benchmark is a tool for easily creating “Swift performance test reports for macOS and Linux”. It works both for ad hoc small code snippets that focus primarily on runtime (in the spirit of Google swift-benchmark ), and for broader metrics such as memory allocation, system calls, thread usage, etc.

package-benchmark supports local usage and benchmark comparisons for iterative workflows for a single developer, but more importantly, it supports GitHub CI integration well. It provides an example workflow for automated comparisons between master and PR branches to support mandatory performance verification of PRs (with customizable thresholds), which is also the tool’s main intended use case.

Moyu Weekly

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

  • Topic in this issue: Apple iOS / iPadOS 16.1 public beta Beta 3 released, supporting pre-stage scheduling for older iPads
  • This week’s study: Troubleshoot and fix the issue of crashing items on the App Store
  • Content recommendation: iOS development skills and computer basic content learning
  • Touching the fish: Nutrition calculator for calculating calories in McDonald’s meals, software that simulates the sound of wooden fish, and illustration software

@Moyu Weekly #71 : The 71st issue of Moyu Weekly, let’s take a look at the summary of this issue:

  • The topic of this issue: Is there One More Thing in October? Apple adds QA activity; Swift and SwiftUI usage in iOS.
  • This week’s learning: Change the text editor background in iOS 16; fix the Showing Recent Messages problem caused by Cocoapods
  • Content recommendation: SwiftUI good article recommendation
  • Touch the fish: Recommend an online image processing website and an old map query website; a maze generator for fish.

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