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.

The article

🌟 🐢Implementing features with ReactiveFeedback

In this paper, the authors introduce ReactiveFeedback, a one-way data flow application framework written by their team, through an example demonstration. Since the author’s team used ReactiveCocoa, they implemented a framework similar to RxFeedback on their own based on Active swift.

Although it’s a tutorial article and I’m writing about my own framework, there are three things to learn from reading this article:

  • To general development, understanding application development can also play this way. If you think aboutRedux.ReSwift.RxFeedbackThese more familiar words, the framework structure and usage introduced in the article is very easy to understand. Even if not familiar with, seriously read also can understand, because the article is really super detailed;
  • To framework maintenance, understand how they do similar architecture evolution. The maintainable, predictable and testability of the application framework of one-way data flow can better solve the problem that a complex application project will be faced with bloat, confusion and difficult to manage. It’s also mentionedReactiveFeedbackThere is no global application state, but each function module has a clear main entrance when interacting with the outside, and only its own independent internal state, which is very simple, flexible and convenient to use;
  • To technical management, it is very meaningful To improve project quality and efficiency through technical means, especially To maintain a set of development framework together. Continuous exploration of application architecture and programming patterns is also a good reflection of engineer culture. The teams that do this kind of technical output a lot are the ones most people want to be on.

🐢 Docker ❤️ Swift & Vapor

As one of the most important technological innovations on the server in recent years, Docker has solved the nightmare of numerous configuration and operation and maintenance. On the other hand, with the booming development of Server-side Swift, it seems inevitable to embrace Docker. This paper is not only an excellent introduction to Docker, but also a brief introduction of what Docker is, what docker can do, and the corresponding learning path. At the same time, it also introduces how to use Docker technology to improve the development and configuration efficiency of Server-side Swift. The author vividly introduced how to make Swift Docker image, how to modify the code in the Docker image in real time, and finally proposed to realize the microservice architecture based on Vapor based on Docker compose, which was very cool! I recommend it.

🚧 🐕 Assertions in Production

The authors explore the use of assertions as follows:

  • How to Report assertions?

    First the author shares a snippet of code that reports the assertion. The authors argue that assertions equal to real user-generated Property Testing are more random, diverse, and unpredictable than Property Testing, and do not require any test cases to be written.

  • When to add assertions?

    The author’s general rule is that assertions should be added in the absence of else. Assertions are also added when: to ensure that the method is passing the correct argument; When using a known key value from the dictionary (e.g. NSNotification ‘ ‘userInfo); Ensure that operations that must be performed on the main thread are currently performed on the main thread. Failure to open a critical database or file.

  • For online products, should I Crash the assertion?

    The author thinks it is not necessary. Assertions can be reported as errors, but should not cause flashbacks.

🐕 Avoiding race conditions in Swift

The Race condition. We all know that when multiple threads access the same resource at the same time, unexpected problems can occur. In this regard, thread safety has always been an extra concern in development. This article describes the scenarios in which race conditions can exist in Swift and how to avoid such problems as much as possible in normal coding.

🐕 What’s .self, .Type and .Protocol? Understanding Swift Metatypes

Swift Metatypes, which may be used every day, is hard to explain exactly what it is, and the Apple documentation is rather obscure, saying type of a Type.

The article starts with the simplest String, describes the relationship between string.type and string.self, concatenates.type.self Type (of:) Protocol, and concludes with some Metatypes usage scenarios.

🐕 React/React Native: Part 1 – React Element & React Component

In the first part of this series, the author hopes to apply the main programming ideas in React/ReactNative to Swift, so as to improve the development efficiency and code quality. According to the author, the core concept of React is to convert Data into view description Data, that is, the process of Data to React Element. In this process, unidirectional data flow is introduced virtually, which improves the standardization of code and development efficiency. This paper introduces how to use Swift to realize Componet, Element and Node.

🐢 Mirror / Custom​Reflectable / Custom​Leaf​Reflectable

In contrast to Objective-C, Swift cannot implement swizzing functionality without a Runtime. However, thanks to Mirror’s reflection, we can get read-only access to object information, and Playground is one of the main scenes of Mirror. This article describes how to use Mirror and the related protocol CustomReflectable CustomLeafReflectable.

🐕 Analysis implementation – Countdown design

A countdown timer is a common requirement in everyday development and can be easily implemented via NSTimer, GCD, or CADisplayLink. After seeing a global timer scheme based on NSOperation, the author of this paper started to think about how to achieve a more efficient and reasonably designed backward timer wheel. From the selection of storage structure to the final logical packaging, the author has completed his own countdown timer step by step.

Although it is a small requirement, but it is a test of the coding ability of developers, I hope that readers can get from the author’s software design thinking.

🐕 The correct position to embed Native components in a Flutter is…

They are the first big factory team to rewrite their App with Flutter. There will be a lot of pits to wade through, which is also worth learning experience for others.

Flutter is also making waves in China recently. If you are planning to apply Flutter or are already trying to apply Flutter, you may want to read the series of articles by The Xianyu Team to save you a lot of trouble. This paper introduces the practice of xianyu team to embed Native code in the project and the principle of the source code behind it. Although there is no control corresponding to AndroidView in iOS, it is believed that there will be corresponding control to follow. At present, students who have requirements on the Android end may wish to learn reference first.

🐕 Custom​Playground​Display​Convertible

This article introduces the familiar Playground, which implements real-time feedback through the PlaygroundLogger framework. Article first half spent a large space to introduce this framework supports the type of display and the use of the CustomPlaygroundDisplayConvertible agreement. The second half of the article starts from the particularity of Playground. Summarizes the CustomPlaygroundDisplayConvertible with CustomStringConvertible, CustomDebugStringConvertible and Debug the relationship between the Quick Look. Read the full text, not only can let us to know how to use the CustomPlaygroundDisplayConvertible, but also know its specific usage scenarios.

🐕 Debugging a subtle Swift bug that will make you facepalm

Jesse Squires fixed a crash in a UI test that was caused by json serialization using [String: Any] as a container and assignment missing a pair of parentheses:

func toDictionary(a)- > [String: Any] {
    var dict: [String: Any] = [:]

    // code setting other keys and values...

    dict[JSONKeys.dateClosed] = self.dateClosed? .toMongoDatereturn dict
}

extension Date {
    func toMongoDate(a)- > [String: Any] {
        // return date in expected mongo date format}}Copy the code

This code is pre-codable, which is proof of Codable’s benefits.

🐕 Analysis of Alipay client architecture: Preliminary study on iOS client startup performance optimization

The Alipay mPaaS team introduced another practice of startup performance optimization. This article mainly explores startup performance optimization from another perspective, using Apple’s Background Fetch to enable the App to handle some preloading tasks in the Background. To solve the time-consuming image loading problem in the actual startup performance. We can also learn about the mechanism of Background Fetch pseudo-background of iOS

tool

Commander

Commander simply means that you write structs using the Decodable & Decoder protocol to describe the input of cli parameters. The Decodable & Decoder library will parse and provide the corresponding description help information, as well as the automatic completion mechanism.

Code Friend

Since Xcode 8, Apple has offered XcodeKit for developing Xcode Extensions, but developers don’t seem to be buying it. Code Friend encapsulates XcodeKit’s native methods through JavaScriptCore and provides a JavaScript interface to quickly develop Xcode plug-ins. You can find it directly on the Mac App Store, but I suggest you read this article first.

Audio and video

“Promises everywhere”, with special guest Max Howell

Back in 15 years, a great guy joked on Twitter about being rejected for an interview at Google. Google says 90% of engineers use the software he writes, but because he can’t flip binary trees on whiteboards, so fuck off… I believe many people have heard of this, and this person, is the famous package management software HomeBrew author Max Howell. Just recently, Sundell invited him to talk about Package Manager design, asynchronous programming, the interview process, and how Swift Package Manager came to be.

push

  • Beijing – Baidu web disk continues to recruit iOS development: social recruitment, fresh year, internship can be. The project was technically challenging and the team’s technical atmosphere was excellent. Sincerely hope that all the gods come to learn, but also welcome a good computer foundation to learn together. Resume email [email protected], temporarily also welcome micro blog private message @xiaofei 86 chat ~

  • Beijing – Ant Financial wants iOS/ Android/front-end development: responsible for alipay membership and account business line, located in Beijing International Trade, 100 meters from the exit of Jintai Xizhao subway station. Interested students welcome to send your resume to: [email protected]/[email protected] (the same mailbox) or micro blog private message @ Tu Fan er _ MSG to understand the situation.

  • Shanghai Jike: if you know a smart, hardworking, ambitious and ambitious engineer, come and join us! Any references or resumes can be sent directly to Jason (Immediate iOS Leader) at [email protected] or @jasonyuh on Twitter.

  • Since 2016, Qizhi Technology has entered the field of Internet of Things and artificial intelligence through collaborative workflow Mesh of industrial UAV, and successfully provided uav solutions for real estate, construction, surveying and mapping, power inspection and other industries. If you are interested, you can find out about it via private message @Zhuo, who has no story.

  • Shenzhen Toutiao R & D center sincerely invites all iOS masters to do pleasing projects together: If you want to know more information about Shenzhen Toutiao, you can add small T wechat: Tomtan, to discuss technology and feelings can oh ~~~~

  • Beijing Bytedance iOS team continues to recruit: you can send your resume to [email protected], or add my wechat account (@aidenrao) Jingmu1994 to get information about my project team.

  • Beijing Baidu Education Business Division recruiting iOS development: Baidu Education Business Division, location: Beijing West Erqi. There are baidu Reading, Baidu Library, Baidu Listening and other App products under the department. The team has a strong technical atmosphere. If you are interested, please send your resume to my email: [email protected].

Pay attention to our

We have opened an official account, which will push messages when each issue is released. Welcome to follow it.

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

The current editor

@Siniang, @Xiangerxiansen, @DamonWong, @Msg, @Zhang Jiafu, @Aidenrao, @Parsifal, @Aaaron7, @Fang Qiulong, @Kyo, @TOM510230, @Anotheren, @Shuishui, @Looping, @lao Lao Lao Lao Donkey, @Xiaofei 86, @Bangben, @red paper, @smiling and drinking arsenic, @Jimq

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)