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.

welfare

🌟 we send welfare ~

The weekly has been with you for almost a year. Thank you very much for your support and love. In order to better serve you in 2019, we have organized a questionnaire survey. On December 27, we will select a few of the friends who participated in the questionnaire to give a learning gift package and cash prize. As for what the prize will be, you can find out in this post, and there will be additional sweepstakes. We are eager to hear from you!

news

App Store Annual Awards 2018

The 2018 App Store Annual Awards ceremony is jointly presented by the App Store and Apple’s official wechat app Store, in order to introduce and recognize selected apps.

Perfect 4 will use SwiftNIO

SwiftNIO is a cross-platform, asynchronous, event-driven network application framework for rapid development and maintenance of high-performance network protocol servers and clients. Vapor, also the framework on the Swift server side, has been fully used in Vapor 3 released in May today. Of course, as an underlying framework, you don’t usually deal with it directly.

The article

🌟 🐕 Decryption Runloop

Runloop is a very familiar term, so you will be asked about Runloop in every interview. Runloop is open source, so the author of this article uses a simplified source code example to explain the basic execution order of Runloop.

  • Basic flow: loop execution (execute task -> notify external -> hibernate).
  • RunloopRely onmach_msgInterprocess communication, that is, receiving and sending messages.
  • RunloopIt will executesource0(can be calledCFRunLoopAddSourceCreate),source1(System call only).
  • RunloopPerform 5 types of taskstimer, mainQueue, source0, source1, block.
  • RunloopBy registeringobserverTo notify the outside world of the current task execution status, while 5 types of tasksMainQueue, source1, blockRegistration not supportedobserverThat is, you can’t passobseverTo get the exact execution time.
  • RunloopActivitythroughobserverTo tell the outside world where it is currentlyActivitywhensource0In the case of being executed,kCFRunLoopBeforeWaitingkCFRunLoopAfterWaitingIt’s going to be skipped, which means it’s just passing throughActivityThe callback to analyze the execution state of the business code is not reliable.
  • Runloop modeDivided intocommon modeprivate mode, the author by capturingmodeGot a lot of strangeprivate mode, respectively to handle different scenarios, for example_kCFStreamBlockingOpenModeUsed to schedule network tasks. As a result,NSTimerIn setting upkCFRunLoopCommonModesOr maybe because ofprivate modeThat causes a delay.
  • Runloop modeYou can switch during the process, including the following switching positions:
    • Before you sleep.
    • Before the mainQueue task is executed
    • After the exit
  • RunloopApplication scenarios:
    • Perform your own tasks, such as timer
    • Used to observe the running status of the main thread

Extending reading

  • Understand RunLoop in depth

🌟 🐢 A Demo introduction to Flutter

Recently, a number of companies have started trying to develop Flutter. Just two days ago, Google held the Flutter Live conference in Beijing. It can be said that the Flutter ecosystem is getting bigger and bigger. This year, if you don’t know anything about Flutter, isn’t it a bit out? It doesn’t matter. There’s an article for getting started. This article not only explains the basic structure of Flutter, but also uses the actual code to write a Demo. If you want to learn Flutter, you may wish to follow it. I believe it will be more effective than just reading the article.

🐕 A modular analytics layer in Swift

Most of the developers in the company are familiar with data tracking, and even half of their time will be spent on implementing the tracking logic. This paper proposes a design of abstract tracking layer, which can be expanded in a Swifty way (adding new events painlessly). It is decoupled from the backend (Switching backend does not require reconfiguration of the client backend) and easy to configure (different backend carries different parameters). The design considerations reflected in this paper can also play a certain guiding role in the design of some common components other than the dot, which is worth learning.

🐢 Seemingly Impossible Swift Programs

In this paper, the proposition of “Judging function equality in Swift” is used to explain complex topological mathematics with simple description and step by step process.

In constructive mathematics, any proposition can be converted to a type, and any evidence can be converted to a value of that type. This allows us to abstract functions into computation and return values. In topological mathematics, an infinite number of data will behave like a finite set. This allows us to prove the equivalence of these computations.

While the process and results of the argument are not useful for your daily Swift development, hopefully they will fuel your interest and awe in mathematics. Know that mathematics has been able to produce such a counterintuitive result, and explain why with extreme succinctness. You can even believe that math is a beacon of how you can do better programming. These simple mathematical structures (Functions, Monoids) form a powerful basis for abstraction, unlike design patterns in projects that are overly complex and solve only specific problems.

🐕 Evaluate photo quality using Metal and Core ML

This paper presents a method to evaluate photo quality using conventional algorithms and machine learning. The conventional algorithms use Metal to process images and derive objective ratings based on saturation, brightness, blur, and color distribution, while machine learning uses Core ML to load NIMA models to predict subjective ratings. After the photos are scored, similar photos are detected and the optimal photos are finally selected and recommended to users.

The demo gives the Metal version of edge detection filter and image feature vector extraction code for learning reference. The paper also summarizes the pitfalls in the process of transforming open source models into MLModels.

🐢 Why should we use Swift over Objective-C?

Swift vs Objective-C, which one do you choose? If you are struggling with this question, read this article carefully.

Objective-c is decades old, more stable; Swift, the more modern language, has many advanced features, and the article compares the advantages and disadvantages of the two languages from multiple perspectives.

🐕 Strategy pattern in Swift

The author of this paper puts forward a Strategy pattern approach to unify the code interface. If you are not familiar with the Strategy Pattern, take a look at this introduction in the Wiki.

This mode can sometimes play a role in the real world. If you are interested in reading the article, maybe you can use it in the future.

🐕 Using errors as control flow in Swift

This article focuses on the use of errors. It introduces some scenarios where errors can have significant advantages. These scenarios include error handling of function output, input parameter validation, and error throwing during testing.

Due to the more or less influence of Objective-C, many students are still not used to errors when writing Swift. If there is such a situation, you can start from the next small refactor to find out if there is a scenario that can be used, try it, and gradually get used to it.

🐕 Xcode UI Testing Cheat Sheet

This article lists common code snippets of UI Testing. In addition to sorting out APIS, there are also solutions to various common problems, which can be used as a quick introduction to UI Testing and a knowledge base for future reference.

🐢 Quality control – picture reduction

In this paper, the author provides three methods to reduce package size through image resource processing. The three methods are:

  • Use the tool to compress the image
  • Find to remove duplicate pictures
  • Find reuse of similar images

The author not only explains the specific implementation principle in detail, but also provides the relevant implementation code. Interested students can refer to the author’s methods to improve their own projects.

🐢 The Metal album

Chinese translation of Metal official documents and Metal related technical blog, suitable for students who are not good at English.

🐎 [AR development] ARKit and ARCore function comparison table and positioning scene summary

ARKit and ARCore function comparison table and positioning scenario summary, if you develop ARKit and ARCore at the same time, may be useful.

design

🐎 Animations in iOS: 30 beautiful examples

There are some iOS animations that are really magical, smooth and friendly transitions that guide the flow, make the user understand what to do next, and make it fun to stare at the progress bar. Here’s a list of 30 animation masterpieces.

code

Kingfisher 5.0 release

The word Reborn in the update log means a major update.

Kingfisher is a lightweight, pure Swift Network image loading library. It’s a big update, but the API doesn’t change much, so if you upgrade from 4.0 to 5.0 it might only take a few minutes to deal with warnings and errors. One of the biggest changes is a better caching strategy. Therefore, students should consider upgrading.

  • joinResultType replaces originaltuplesThe callback
  • To facilitate debugging and error tracing, error messages are returned with the error cause and necessary associated information
  • ImageCacheOverrides, provides memory and hard disk caching policies,APICompatible with older versions, while providing control of the cache maximum, whether to pre-cache and other configurations
  • Cache strategy: search memory first, or search hard disk
  • supportImageDataProviderProtocol loads local images

Please refer to:

  • Kingfisher 5.0 update highlights
  • Kingfisher 5.0 Migration Guide

Swift official Docker image

Swift images maintained by Apple have now been officially accepted by Docker. Therefore, you only need to execute Docker pull Swift to conveniently build each version of swift environment. At present, Apple’s maintenance of this image is quite high, the latest support to Swift4.2.1, and the development version of the synchronization.

Audio and video

🌟 Functional Swift Conference 2018

Swift has had a huge number of functional programming features since its inception, whether it’s enum and optional implementations, or functions being treated as a class of citizens, the whole language has a lot of Haskell in it. Naturally, Swift is also very handy at implementing some functional ideas and features. Swift functional programming, at present, the most classic application scenario is mainly to build responsive viewModel. Now, more and more people are exploring other scenarios. Functional Swift Conf is a technical conference in New York dedicated to Functional Swift, and has now released all presentations, except some reactive View Model and other familiar topics. There are also interesting things about state management, composable UI, etc. Those interested in functional programming should not be missed.

Ggtalk | should buy HHKB? I asked seven users what they had to say

Keyboards, especially mechanical ones, have long been the most important item for programmers traveling home. Even for most programmers, a keyboard may be one of the few things they spend money on all the time, which brings up the question: what is the last keyboard for most programmers? In this ggTalk, several programmers have talked about their feelings about using HHKB.

PS: There is no rigorous and objective evaluation. Subjective feeling is more, more relaxed.

🚧 MVC is Not Your Problem – Joachim Kurz – UIKonf18

In recent years, the MVC development model has been criticized and often complained about too much code and too much coupling. So there are a lot of people trying to solve the problems of MVC by constantly breaking it down and improving it.

This sharing on UIKonf is about architecture design from the PERSPECTIVE of MVC. It starts with an introduction to the MVC pattern, then points out that many people misunderstand and use MVC incorrectly (there are a lot of references in the share, which is well researched), and then leads to a point that people tend to overlook: the problem is not the architectural pattern, but the way it is used. Even other architectures bring other problems, how to achieve development goals through MVC and other architectures is the key.

The sharer, Joachim Kurz, has a very clear point of view: architectural design does not need to follow rigid and applicable specifications, but can be done by looking for appropriate decomposition dimensions (introduced at the end of this share, 27 minutes later), so that the architecture can be reasonably understandable. This degree of architectural design is difficult to grasp, it is necessary to go deep into the specific requirements of the scene (share a few examples, including the introduction of a page to use 10 ViewController), in the usual development process of continuous practice and summary.

push

  • IOS /Android developer: Responsible for the development of Xiaohongshu APP, which has changed the lifestyle of most people. We have changed the way most girls look at life. Join us and build the next hundred million user product together with a group of young and interesting partners. Email address: [email protected]

  • 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 me (@aidenrao) on wechat Jingmu1994 to learn more information about the company and the position.

  • 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, and every issue will be released on the official account (OldDriverWeekly), welcome to follow.

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

The current editor

@Siniang, @Xiangerxiansen, @DamonWong, @Zhang Jiafu, @Aidenrao, @Parsifal, @Aaaron7, @TOM510230, @Anotheren, @Shuishui, @Looping, @lao Lao Lao Donkey, @Bangben, @red paper, @Smiling drinking arsenic, @ JimQ XanderXu

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)