This week is the Spring Festival, the weekly newspaper will not be updated during the Spring Festival, wish you all have a good year.

news

4.1 the new Swift-OsizeOptimization mode reduces code size

Swift 4.1 will ship with iOS 11.3 and Xcode 9.3. Optimization Level adds -osize mode to reduce compiled code size. According to the official description, enabling -osize reduces code size by 5% to 30% with negligible performance impact (less than 5%).

Compilation Mode can also be created independently from Optimization Level, with options for Single File and Whole Module.

Key Components of iOSiBootSource code leakage

IBoot is one of the key sources of iOS. It ensures trusted startup of the operating system. In other words, it is the program that loads iOS and is the first process that starts the iPhone running. It loads and verifies that the kernel is properly signed by Apple, and then executes, just like the iPhone’s BIOS.

Apple has confirmed the incident and said it was iOS 9 code that was leaked.

Apple has signed a deal with Inner Mongolia to build its second data center in China

Apple inc. will build China’s second data center in Wulanqab city, Inner Mongolia, and put it into operation in 2020, thus forming a pattern of two data centers, namely “southern Guizhou and northern Ukraine”.

The article

IOS KVO Crash self-repair technology implementation and principle analysis

A year ago, Hangyan’s blog “Baymax Health System — Automatic Repair System for iOS APP Crash” sparked a lot of discussion. Use the runtime dynamic feature to protect some common crashes:

  • unrecognized selector crash
  • KVO crash
  • NSNotification crash
  • NSTimer crash
  • Container crash (array out of bounds, insert nil, etc)
  • NSString crash (string operation crash)
  • Bad Access Crash (wild pointer)

The blog introduces the implementation principle, but does not publish the code. Now, according to the grapevine, netease’s library is not fully used internally and the open source plan has been shelved. A similar codebase, BayMaxProtector, was written by the community out of a learning mentality.

In this paper, a new scheme is proposed to protect KVO crash by establishing a hash table to store the information of observer and keyPath, and to update the status of the object dealloc.

Swift Algorithm academy – Find the k-th value in the array

An algorithm for finding the KTH value in an array is introduced. For more examples of Swift based algorithms see Raywenderlich/Swift-algorithm-club.

In Swift (ii) : Overview of algorithms and sorting algorithms

This is the second part of the serial series “Data Structures & Algorithms in Swift”. First of all, we briefly explain the basics of algorithms, including the concept of algorithms, time complexity and space complexity, and recursion. Then combined with Swift code implementation explained the sorting algorithm, including selection sort, insertion sort, merge sort and quick sort.

IOS architecture of View layer architecture scheme

After Casa shared iOS application architecture about view layer organization and call scheme in the first two years, this is another view layer architecture analysis article fresh from the circle now. In the end, Casa put forward “splitting three minds” and “designing four minds” that view layer architecture mode should follow from a broader perspective.

This article is relatively short. From “How to evaluate an architectural solution” -> “BRIEF Analysis of several mainstream architectural modes such as MVC/MVVM/MVP/VIPER” -> “Final solution within the team”, the author gradually shares the practice process of architectural solution suitable for his team. Students who are beginners in architecture design will be more friendly. I suggest that you read this article before you chew on Casa’s article.

Crash symbolization

The author has written a total of three articles, from the basic process and related commands to symbolicatecrash source analysis and optimization, and finally Mach-O and ATOS, explaining the whole process of iOS Crash from generation to symbolization from simple to deep.

All that stuff about operators in Swift

This article mainly introduces an Error handling skills, through the custom operator to simplify the Error handling code, no complex logic and abstraction, simple and practical, strongly recommended 👍

What does WebAssembly do? Eight WebAssembly application cases

WebAssembly’s feature is that it runs faster than JS in the browser. Although it is still a proposed technology, major browser manufacturers have followed suit, so there are many practical cases of WebAssembly. This article introduces 8 cases. As you can see from this introduction, WebAssembly is widely used in these directions

  • Compiling other languages into WebAssembly to run in a browser;
  • WebAssembly for game engines and graphics rendering;
  • Is to speed up the original JS code.

Protect sensitive information about iOS projects in Git

If you open source code that involves sensitive information, such as API keys, HMAC secrets, or passwords, it’s a good idea to put it in a newly created XCConfig file and Git ignores it. Finally, create a sample configuration xcConfig file that does not include the values.

Other developers can easily run projects without sensitive information by simply filling in the sample configuration file and renaming it.

Swift 4.1 improves Codable with keyDecodingStrategy

Swift 4.0 has added Json to Codable for easy parsing, but Json is a common data format that is commonly used to interact with other platforms whose naming conventions require Json key mappings to be declared if they are not humped. 4.1 added keyEncodingStrategy to configure automatic conversion of two common naming conventions:

let jsonString = """
[{
    "name": "MacBook Pro",
    "screen_size": 15,
    "cpu_count": 4
    }]
"""

struct Mac: Codable {
    var name: String
    var screenSize: Int
    var cpuCount: Int
}

let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToSnakeCase
let encoded = try encoder.encode(macs)

Copy the code

Parallel programming with Swift 1. Basics 2. Operation

The first article describes the various ways in which parallel programming with Swift can be done, from Process to higher-level abstractions such as Operation, how to control the order of concurrency, and the use of locks and signals.

The second chapter is mainly about Operation, including the INTRODUCTION of API, lifecycle, dependency and encapsulation.

This series is from simple to thorough, with clear pictures. By the way, I recommend their team Flawless’s blog, where they share many techniques and the quality is very high.

Comics: Git binary Debug, quickly locate the error code!

Git bisect is a dichotomy debugging tool provided by Git. It can be divided according to our selected commit list to quickly locate the wrong commit. To help us narrow down the code with minimal changes so we can quickly locate problems. The author also uses the form of cartoon to help readers deepen their impression.

tool

PodsUpdater–A macOS app which helps you manage dependency releases in your Podfile

A small tool to help you manage the dependencies of CocoaPods in your project. It clearly shows the dependencies in your project and the latest version of that dependency, and provides automatic adaptation of compatible versions.

Share the author encountered in the process of using a pit, the reason is that some older private source configuration is HTTP url, resulting in fatal: could not read the Username for ‘http://git.privatesource.com’ : Device Not configured, meaning the tool does not have permission to pull your private source when performing a POD repo update. Solution is simple, the old source url changes into SSH url, configuration file path to/Users/your_username /. Cocoapods/repos – private – podrepo /. Git/config

CoreML model repository

CoreML launched by iOS11 allows App developers to quickly use the trained model in App without Learning Deep Learning or training models themselves. In addition to apple’s open Object detection model, where can I find more trained CoreML models? There are 3 links, which have a lot of interesting models trained, such as photo to oil painting/facial emotion recognition/figure age guessing/article classification/text emotion recognition, etc., which are good news for iOS developers and can be used to make some interesting personal idea apps

  • coreml.store/
  • Github.com/likedan/Awe…
  • Github.com/SwiftBrain/…

Carbon

Carbon is a tool for generating high-grid images of code online. It has the following features:

  • Can be imported directly from GitHub GIST;
  • Highly customized, can adjust the syntax theme, form style and other parameters;
  • Easy to share, one click to publish/save pictures.

GitHub address: github.com/dawnlabs/ca…

CTF Wiki

CTF (Capture The Flag) originated at DEFCON in 1996. It is a competition among network security professionals.

CTF Wiki is a free website that contains the basics of CTF, common question types, solution ideas, and common tools to help you learn about THE CTF contest and network security.

GitHub address: github.com/ctf-wiki/ct…

The current editor

@No story, @Siniang, @Mmoaay, @Heiersen, @Eyrefree, @DamonWong, @Msg, @Zhang Jiafu, @Aidenrao, @Parsifal

instructions

🚧 indicates that you need to climb the wall