Old driver iOS weekly, just for you to present valuable information.

You can also contribute to the project, if you find valuable information, articles, tools, etc., please send it to us in Issues, we will deal with it as soon as possible. Be sure to include a reason for your recommendation. Suggestions and comments are also welcome to Issues.

Welcome our new editor @crazyCodershi to join our weekly team. @crazyCodershi has in-depth research on cross-end solutions, especially the direction of Flutter. We hope to bring you more quality content about Flutter in the future

news

Can we do something for 996 programmers in China?

996.ICU has recently caused quite a stir in Chinese Internet circles, as the GitHub warehouse has accumulated 18W + star. Guido van Rossum, the father of Python, was also concerned about the issue, tweeting early on and now launching a community discussion in the hope of collecting practical measures to improve the situation.

The novice recommended

🌟 flutter_go / flutter_ui

@ CrazyCoderShi: Flutter has been a hot topic since its release. For beginners, a complete and standardized project is a valuable learning material. Flutter_go comes from alibaba auction front-end team, and Flutter_UI comes from YY team. The code specification fully follows the Effective Dart specification, which is a must for newcomers to FLUTTER. Through these two projects, you will learn the following:

  • Use of flutter basic components
  • Flutter Animation Application (Flutter_UI)
  • Flutter State Management Based on Scoped_Model (Flutter_UI)
  • How to organize a multi-tab application

🐕 Easy to understand the KVC foundation

JimQ: A step-by-step introduction to KVC technology.

  • Firstly, a series of API interfaces related to KVC are described in two parts: general and special usage, and the mind map of these apis is given.
  • The principle analysis and practice point out that the most critical part of KVC protocol is the visitor search mode, and introduce one of the modes, namely the search mode of variable group.
  • Finally, whether there is correlation between KVC and KVO implementation mechanism is discussed, and IT is considered that KVC is the foundation of KVO implementation.

The article

🌟 🐢 Applets render architecture design

BATT, wechat, Alipay, Toutiao, Baidu, have launched their own small program, the concept of small program has been widely infiltrated into the major companies and major platforms.

  • What are the benefits of applets architecture? Why do companies tend to use such small – program architectures?
  • What is the architecture of applets? What are the differences between the implementation of this architecture and the H5/RN/Flutter?

With those questions in mind, let’s take a closer look at “applets” from a user perspective/platform perspective/architecture and code implementation perspective.

🌟 🐕 Burn My Calories – Flutter Thin Memory, Thin pack image rendering components

Tom510230: This paper introduces the specific performance optimization scenarios encountered by Idle Fish in Flutter engineering and improves the solution ideas

  1. Memory problem – Memory accumulation on the continuous push FLUTTER interface

  2. Installation package problem – two duplicate resource files for transition period

  3. Addressing cache problem – old addressing cache policy cannot be reused

  4. Image reuse problem – Native and Flutter download the same image repeatedly

In general, in order to achieve similar performance of Flutter as Native, the Flutter Engine needs to be deeply customized without relying on the native hybrid components. This paper focuses on the performance improvement of OpenGL rendering.

🐢 Technical implementation of all Block method calls of run-time Hook

The Hook mechanism may be used in the project to monitor, intercept or count some behaviors. You can Hook an OC Method using the Method Swizzling technique. You can Hook a C function by modifying the information in the address table of the imported function. This requires solving the following problems:

  1. How do I replace all Block invoke functions with one unified Hook function at run time

  2. How does the unified Hook function call the original Block’s invoke function

  3. How to build this unified Hook function

The Block object is also an OC object, and the final replacement is the retain method. If you are interested, you can learn why and how to replace the retain method.

🐎 Cross-platform technology evolution

@ aaaron7: The growing popularity of Flutter marks the third stage of wireless cross-platform technology, from the initial hybrid application of H5 + Native, to RN/Weex based on DSL + Native components, to Flutter with DSL + cross-platform rendering components. The rapid iteration of cross-platform technology in recent years has also promoted various fusion and attempts of wireless end technology stack and front-end technology stack, and also evolved innovative technologies such as PWA and small programs in unique application scenarios. In this paper, the author summarizes this series of technologies and analyzes the advantages and disadvantages of them, which is a good popular science article. General depth, suitable for technical students who do not understand the relevant technology to learn.

🐎 Swift Tip: Collection Protocols

In Swift, there are many protocols related to Collection, each of which has its own role. It will be very helpful to understand the role of these protocols when writing algorithms. This article is excerpted from the book Advanced Swift, and the authors are in the process of updating Swift 5 for free if you bought the digital version before.

🐢 A Glimpse into Generic Meta-Programming in Swift

VFL (Visual Format Language) is an abstract Language introduced by Apple in order to simplify the coding of Autolayout. Its expression is usually a string, and the compiler cannot verify whether the expression is wrong during compilation. With this background in mind, the author of this article introduces generic metaprogramming in Swift using the example of building a VFL helper library that is secure at compile time. Click here to view the source code of this article, and a translation of this article is available.

🐢 Introduction to Swift Keypaths

Speedboy: It is easy to use Keypath for type-safe assignments and values to a class in Swift. This article first introduces the basic usage and concepts of Keypath in Swift, then gives some practical examples, and gives some suggestions and tips on how to use Keypath in daily work.

Recommended by yuhanle

🐢 The Pragmatic Guide to Scalable Swift Architecture for 2019

@Siniang: This is an essay on architecture. The author explains his understanding of architecture in the form of questions and answers:

  1. How do highly paid programmers step up architectural changes on the team?
  2. How to solve the problem of asynchronous code logic dispersion?
  3. How do you ensure security and reusability during dependency injection?
  4. How can ViewController code be of better quality through decoupling of states and events?
  5. How to decouple jump logic in ViewController?

design

🐕 Everything you need to know about Loading Animations

@Zhangjiafu: This article is an in-depth introduction to loading animations, including the history of loading animations, a how-to guide, when to be concise and when to be full of detail, useful tools and resources to help you create a better user experience.

tool

cocoapods-binary

@xiaofe86: In CocoaPods, Xcode will still recompile the Pod even if no changes are made to the Pod in the project. This can be a pain in the neck in large projects. As a result, Carthage even makes binary management its core feature. CocoaPods Binary supports Binary management through CocoaPods Binary.

CocoaPods Binary implements Binary management by pre-compiling your Pods during Pod installation and then adding binaries (such as Framework files) to the generated Pods project so that Xcode does not have the opportunity to recompile the code.

CIFilter.io (Core Image Filter Reference)

Anotheren: CIFilter is an important part of Core Image, but the document provided by Apple has indicated that it will not be updated any more, and there is a lack of instructions for the use of CIFilter newly added to the system. Cifilter. IO provides a complete list search and its usage. It even provides an App to show how each CIFilter works in practice, and you can find the source code here.

code

🌟 Matrix for iOS/macOS

@J_KNight_ : Matrix for iOS/macOS is a Performance probe tool developed by wechat team and used daily. It is currently integrated into the Application Performance Manage (APM) platform of iOS and macOS wechat. Matrix for iOS/macOS currently monitors the following areas: crash, lag, and memory explosion.

  1. WCCrashBlockMonitorPlugin: capture card, stack plug-in framework based on KSCrash development, has the following features:
    • Check the running status of Runloop to determine whether the application is running properly and supports iOS/macOS.
    • Time stack extraction ability, can obtain the most recent time of the main thread stack.
  2. WCMemoryStatPlugin: A memory monitoring plugin that can capture the stack and memory allocation when an application runs out of memory. It has the following features:
    • Obtain the object survival and stack information during application running, and report it when the application memory burst is detected.
    • Use balanced binary trees to store live objects and Hash tables to store stacks.

Recommended reading:

  • Matrix for iOS/macOS is now open source
  • Matrix-ios Caton monitoring

🌟 objc_msgSend_hook

Red paper: the author uses fishhook principle to skillfully implement the Hook of the simplified version of objc_msgSend function under arm64 architecture. The amount of code is very small, it can work effectively and every line of code has comments.

Interesting recommendation by @ first

RoughSwift

Swift is a cartoon-drawn style graphics library that provides all basic types (lines, rectangles, circles, arcs, etc.), including SVG Path. If you want to make a cute and interesting APP, consider using it.

LVThemeKit

@JIMQ: The author used the function of switching between multiple areas and multiple sets of skins in the development. Many redundant codes were added when new functions or themes were added in the previous version. A reconstruction was carried out for this with the help of OC generics and KVC, and the code was the implementation after reconstruction.

Recommended by Lv Pengwei

push

Senior driver Weekly team combined knowledge collection and SwiftGG Translation group included a reliable internal promotion position.

If you want to looking for a job, click here: www.yuque.com/iosalliance…

If you want to recruit people, click here: www.yuque.com/iosalliance…

Of course, you are also welcome to pay attention to our weekly report, we will update the editorial post at the bottom of each weekly report.

Pay attention to our

We have opened an official account, and every issue will be released on the official account (OldDriverWeekly), welcome to follow.

RSS feeds are also supported: github.com/SwiftOldDri… .

instructions

🚧 indicates the need to climb the wall, and 🌟 indicates the editor’s recommendation

Estimated reading time: 🐎 in a short time (1-10 mins); 🐕 medium (10-20 mins); 🐢 slow (20+ mins)