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

🌟 The Result type is added to the standard library

After a whole month of discussion, the Result type was finally decided to join the standard library, and it is expected to be implemented in Swift 5. This proposal attracted a large number of people, and was finally approved after two modifications and three discussions.

The discussion focused on the definition of result. Error. Meogod also wrote an article to discuss this problem. In a word, Swift has not implemented Typed Throw for compatibility and implementation, so result. Error is difficult to be implemented as a generic parameter. It was even decided during the draft phase that result. Error would not follow swif.error.

The Swift team ended the discussion by adding a backdoor to the proposal and tweaking the implementation of the generic parameter so that swift.error is the only generic type that currently exists as a generic parameter, in order to interact better with the Cocoa API.

This time I can see that the Swift core team still want the Typed Throw to have a specific type (not a generic swift.error), so they are using this kind of transitional solution by the back door. This proposal makes me feel that there is still hope for the Typed Throw.

In addition, if you have concerns about compatibility, since the author of the proposal is one of the principals of Alamofire, there is little difference between the final version adopted and the Result adopted by Alamofire. If you adopt the Result of this version, you do not need to worry too much.

Flutter 1.0 official: Google’s portable UI toolkit

The much-anticipated Release of Flutter 1.0 has come more than nine months since we first saw the Beta version of Flutter 1.0. Flutter’s great features, such as high performance cross-platform rendering and hot reloading, are sure to make mobile developers’ dreams come true. There have been many companies and teams experimenting with Flutter in the early beta. Now that Flutter 1.0 is here, mobile developers should certainly feel its appeal.

The article

🌟 🚧 🐢 Dependency Injection on iOS — Part 1-4

The topic of this long article is about architecture, starting from the application of dependency injection on iOS, divided into four articles. The authors describe the concept of module coupling, to introduce the use of dependency injection can bring us benefits, reusability, maintainability and extensibility and testability), and recommended a dependency injection framework (Swinject) after start – to get down to business by writing and optimization of a simple application to practice the concept of dependency injection and feel the benefits of it. The full text structure is very clear, the example is also very detailed, is a study and comprehension framework, especially dependency injection good article.

🌟 🐢 IOS App cold launch governance: From the practice of Meituan Waimai

The paper sorted out the three stages of APP cold start, and proposed the stock solution, management increment plan and monitoring system for the three stages respectively. The following points are a summary of the article’s views:

  • Cold start stage T1: Click the APP icon to enter the main function, the time between the two
    • Thin code, scrap useless code and resource files
    • The delay +load function delays the function until an appropriate firing time, such as after the cold start is over
  • Cold start stage T2: after the main function, to didFinishLaunchingWithOptions function has been completed between the two time consuming
    • Sort out the APP startup stage and sequence the startup sequence of sub-projects
    • Start in stages, use self-testKylinProject, writes the registration information for the subproject (startup phase, code to be executed for startup, etc.)__DATAData segment, read at run time__DATASegment code, and give execution.
    • Use tools (Time Profile/ self-developed Caesium) to sort out the hidden Time of execution, such as archive operations, IO operations, resource tasks, etc
  • Cold start stage T3: didFinishLaunchingWithOptions function to the home page rendering completed, time between the two
    • Set the RootViewController of the APP as a flash screen, and build the UI of the home page at the same time to speed up the loading of RootViewController
    • Sort out the serial operation loaded on the home page to optimize the experience into parallel operation
  • Data monitoring: in addition to the above optimization, establish monitoring system to ensure continuous optimization results
    • Comparing the start and end time of cold start, it is worth noting that the start time is the creation time of APP process
    • Key nodes in the process of cold start have speed measurement points added manually and reported automatically

🐕 How to Improve productivity – Automation

In this paper, the author introduces several automation implementation schemes in the macOS environment, and tells us the general implementation process with his own practical cases, as follows:

  • usingShell ScriptAnd start the loading task, automatically configure dual network adapters during the boot process
  • usingApple ScriptaccessMicrosoft OutlookAutomatically generate and fill mail, complete daily mail report
  • usingApple ScriptAnd hotkeys to quickly locate the current Finder path into iTerm’s window
  • usingApple ScriptAlfred WorkFlowsMake quick save/search records for instant thoughts
  • usingShell ScriptApple ScriptPeriodically pull and compile code

🐢 IOS memory management stuff

Memory management in iOS has always been a headache for developers. Since the advent of ARC, although we no longer need to manage memory manually, it is still necessary to master the relevant knowledge of memory management.

The author explained the implementation principle of memory management in detail by reading the source code, and listed some common scenarios that are easy to cause memory leaks in daily development, which can help us better avoid memory-related problems in complex business scenarios. And the author will introduce some open source memory leak detection tools and implementation, you can continue to pay attention to.

🐕 Rethinking Design Patterns in Swift: State Pattern

This article shows how to implement State patterns in Swift, taking advantage of Swift’s power to make pattern implementation simple and flexible. This article uses an example to explore various aspects of the state pattern and assess its ability to handle changing requirements. The key considerations, benefits, and practical applications for implementing the model are then discussed.

🐎 The growth of technical people

Starting from his own experience and perception, the author describes the growth path of technical people from three dimensions

  • Resist the temptation of so-called “full stack” and focus on the domain.
  • Expand vision and improve technical acuity.
  • See and try, don’t dream

In general, after reaching a certain level of skill and proficiency, we can expand our knowledge in breadth and delve into a certain vertical field in depth, which will greatly help us advance from ordinary engineer to senior engineer.

🐕 Category: From basic principle research to interview question analysis

With the development of mobile terminals, we can see from the step by step upgrade of weak interview questions, we should have more in-depth understanding of the underlying implementation details.

The author carries on the step by step tracking and analysis from the source code, collates the whole Category execution order, which is very suitable for the students who want to understand its working principle. A simple animation sketch is also provided. Through reading, you can clearly answer several Category related questions that are common in interviews.

Load and Initialize also provide source analysis and comparison tables. If you’re preparing for an interview, this is especially good for you.

🐢 IOS: ARM64 variable function parameter debugging analysis

Starting from a platform-related crash problem encountered in the actual development, through code comparison, this paper studies the differences between x86-64 architecture and ARM64 architecture in passing variable function parameters, especially in iOS system. Meanwhile, it also explains why when calling C function pointer with variable parameter type, The function pointer problem of forcing it to the corresponding parameter type should be displayed.

🐢 Protocol Oriented programming in Swift: Is it better than Object Oriented Programming?

This is a new SwiftGG translation recommended in last month’s weekly issue 42.

🐢 Swift Protocols: Tips and Tricks

Protocol is the basis for Swift, and we can define methods and even provide a default implementation. This article covered tips for Protocol, such as Protocol combinations, Protocol Extensions, design patterns using Protocol implementation template methods, and more.

🐎 8 Useful Swift Extensions

There are eight Extensions that are useful to Swift, such as the number of characters in a string, counting the number of days between dates, prefixing strings, etc. Of course, I think these 8 are far from enough for daily development, so I recommend you to take a look at SwifterSwift library, which is a very useful Extension. If you have a good Extension recommendation, you can also contribute your own code to this library.

🐕 simctl

Simctl is a command-line tool that Apple provides to developers to drive Xcode Simulator. It allows you to: start the emulator, copy and paste between desktop and emulator, record video, and so on.

🐢 Swift Program Distribution with Homebrew

This article describes how to distribute command line tools when you create them for MAC, Homebrew.

  1. Create a Makefile
  2. Write a Homebrew Formula (equivalent to compiling a package)
  3. If you need to test yourself, you can try local installation first to ensure that the installation process is smooth
  4. Homebrew installs Formula based on Tap, so you need to publish a Tap
  5. Users can now install formulas based on remote Tap

🐢 Days of Fighting JOSE – a cryptology primer for iOS developers

JOSE (Javascript Object Signing and Encryption) defines a set of standards that govern how JSON can be used over the network, This article showed you how to use security.framework to handle authentication in JOSE. Compared with the existing JOSE implementation frameworks, such as JOSESwift, JsonWebTokt. swift, SWIFt-JWT, vaper/ JWT, etc., the advantage of the author’s scheme is that it supports BOTH RSA and ECDSA, and does not need to introduce complex dependencies

tool

Publish Your Flutter App on macOS

Recently, Flutter expansion does not seem to stop. Instead, it seems to become more and more fierce.

Flutter can write iOS and Android apps, but also “supports” macOS, Windows and Linux. But it’s not official support, it’s just mobile apps running directly on the Desktop, like iOS apps running on macOS next year.

Google Github Repo has a project called flutter-desktop-embedding that does this kind of bridge work, but the library is not very good, it is difficult to use.

So there are third-party developers who make a tool based on flutter-desktop-embedding, which can easily integrate your existing Flutter projects into macOS package. They also created a small store that developers can upload with a click and others can easily download and install.

Interested kids can try running their Flutter App on macOS to see how it feels.

Audio and video

Chat ggtalk | Swift these four years (below)

I recommended the first part last week and received a good response. In this issue (part 2), several programmers talk about what’s happened in Swift in recent years, such as the massive takedown incident caused by Jspatch, and some stories from the 2nd and 3rd Swift Developer Conferences. The final discussion of Swift’s future is equally fascinating and not to be missed.

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 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, 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)