Recently, some developer friends asked me how to improve my ability. In retrospect, I have been doing iOS development for so long, and I also had the kind of “let me do a feature to achieve a requirement, I will do it, but I don’t know how to improve it next.” Period, here try to list the iOS development of related technologies, and then say some of my ideas on learning progression.

IOS technology stack

According to my understanding, ios-related technologies are divided into four categories: foundation, requirement, efficiency and quality from the perspective of engineering implementation. The foundation refers to the basic knowledge and skills of program development and iOS development, and the requirements are the requirements of the product. With the basic skills, the rest of the work is to improve the quality of the project and improve the development efficiency.

General mind mapping:

basis

The basics include language, framework, memory, networking, storage, rendering, and threading.

At present, the iOS development language is OC and Swift, and OC is still the main language in China. Besides the syntax of OC, it is better to understand its object model, dynamic mechanism and other features. For Swift to be used in teams, the risk is high and the benefit is low, but it is best for individuals to keep an eye on it.

So the framework is Foundation/UIKit and the various frameworks that apple encapsulates, and everyone who does iOS development is familiar with Foundation and UIKit, and as iOS has more and more features, Apple has more and more frameworks, Things like StoreKit/MessageUI/AVFoundation can be learned after they are used.

Then there are the four key parts of the most common process on the client side: pulling data from the network, storing it to the local file system, fetching it from the network, putting it into memory, and rendering it. All of this processing takes place in the processes and threads of the operating system.

In terms of network, there is a lot of content to go into. Generally, the client only needs to care about HTTP/HTTPS/DNS protocols, understand the principle of HTTPS, deal with the situation of carrier hijacking DNS hijacking and so on. In addition, it needs to deal with all kinds of exceptions and make a retry mechanism. Depending on the situation, optimize connections on weak networks, have offline mechanisms in place, and be careful not to consume too much traffic. There is also the communication protocol between the client and the background. The data structure is usually JSON or Protobuf. Because the client will save part of the content locally, many apps will need to do incremental update of the data.

In terms of storage, SQLite is the core of most apps as a storage engine, and also the key point of performance optimization. The most basic need to know the basic concepts of database such as primary key index transaction, and further in-depth need to understand the specific storage mechanism/index implementation/sqLite seven-layer structure, etc. In order to find the best solution to the problem. Nosql is rarely used on the client side. In addition to SQLite, only single file storage is available. XML files or objects are serialized into binary storage, which is also a common storage method.

In terms of memory, you need to know the reference count of OC, ARC mechanism, automatic pool release and other related points. It is better to know the garbage collection mechanism of other languages as well. In addition, you need to pay attention to avoid memory leaks, manage the cache of the client, and avoid the OOM, or the cache hit ratio is too low.

On the basis of text, UIKit has encapsulated well, and CoreText also provides a more free way of typesetting rendering. Image rendering only needs to pay attention to the decompression time, and further understanding of the specific rendering mechanism of iOS, such as layer mixing, rendering time, off-screen rendering and so on, can make more optimization.

In terms of thread and process, iOS development only needs to consider the process when doing Extension. Generally, it only needs to deal with thread well, and it needs to understand the main thread, subthread, multi-thread concurrent lock competition, deadlock, GCD, Runloop and other knowledge points.

demand

The requirements side can be summarized as general requirements, special requirements, and operational requirements.

Common requirements are the above mentioned network pull data -> storage -> read -> display, most apps are mainly in the realization of this kind of requirements, familiar with the above basic knowledge can be easily realized.

Special requirements refer to the requirements of some specific apps, such as browser kernel, text typesetting engine, audio and video and image processing engine, icon rendering engine, etc., which have high requirements and require in-depth study in related fields to do a good job.

Operation requirements refer to the requirements in the continuous operation process of the APP after its launch, including the dynamic function, which can be added, deleted and changed at any time. Generally, this is undertaken by the embedded Web. A configuration system is also considered dynamic and can control the functions displayed by various switches. The statistical system records APP operation data, including user growth, retention rate, function usage, etc. The flow of events clearly shows the user’s flow through the APP. Some apps also develop recommendation systems to push different content to different users based on the collected data, so as to improve the conversion rate of users.

The quality of

The larger the APP, the more effort will be spent to ensure and improve the quality of the APP, including performance optimization, building monitoring system, improving code quality, ensuring safety, and ensuring quality through testing.

Performance tuning range is very big, in the network / / storage/memory/rendering algorithm optimization in many aspects, on the general performance optimization can be divided into three steps, one is testing all aspects of the data, the quantitative performance, 2 it is to find performance bottlenecks, 3 it is to find ways to optimize, the first step in data validation optimization effect.

Monitoring system in products for the public users both front-end backend has always been very important, you always need to know what the user in the process of using your product have what problem, let your APP in the known controllable state, the client of the most common point to Helen, this needless to say, and generally for the error code in the APP, Local errors, network errors, etc., need to be monitored so that when an exception occurs, it can be immediately known for handling. Other common monitoring includes lag monitoring, database monitoring, traffic consumption monitoring, memory consumption monitoring, various time monitoring, etc., as well as various kinds of business related monitoring. The larger the APP, the more detailed the monitoring projects are, the purpose is to find problems in time, and measure the quality of the APP. In addition to monitoring the problem, there is also a need to take corrective action in the event of an error, either by embedding functional switch configurations or by accessing hotfix libraries.

In terms of security, the security component of the client side is much less than that of the server side. Especially under the protection of the sandbox mechanism of the iOS system, the client side is relatively secure. The most important thing to pay attention to is the security of network transmission, to avoid the tampering of the network transmission content or the disclosure of sensitive information such as user names and passwords. For the code with confidential information can consider obfuscating the code to harden the APP to reduce the probability of being cracked.

Code quality is primarily a matter of teamwork. Teams define code specifications to keep everyone’s code style consistent, and some develop code specification inspection tools to ensure that submitted code complies with the code specifications. In addition, many teams will implement the code review mechanism to check each other’s code and reduce the probability of dirty code. The specific review mechanism varies from team to team.

Testing is a professional, because of the fast iteration of domestic terminal products, the common is black box testing, although can not guarantee no problems, but low cost and high efficiency, part of the stable core functions will do unit testing, there are also some teams all business functions do automated testing.

The efficiency of

Client architecture can say is to improve the efficiency of development cooperation, because the function can be used a lot of kinds of methods, may not need what architecture, whether large or small can be implemented by a set of APP, but poor architecture on large APP code will be very confusion, resulting in development/cooperation/debug efficiency will be more and more low, Good architecture will improve efficiency here. Most architectures are layered abstractions and decoupled, separating out functionally independent components, modularizing the business, clearly layered responsibilities, and not coupling each other. As long as the hierarchical abstraction and decoupling are done well enough, no matter how big an APP is, it is a patchwork of many small modules, which can reduce the complexity and improve the development efficiency. But sometimes decoupling leads to communication problems, and abstractions have granularity issues that need to be weighed on a case-by-case basis. There are a variety of architectural patterns to refer to, such as MVC/MVVM/MVP/VIPER, etc. In addition to understanding decoupling and abstraction, there are architectures that change the way you program, such as responsive programming, one-way data flow, and so on.

Continuous integration means to continuously integrate what everyone is doing (code/resources, etc.) into the output, automate the build, which involves code management (Git/SVN), build processes, certificate and signature mechanisms, automated testing, packaging and distribution, etc. There are also custom automated processes, such as automatically generating code, automatically changing configuration based on debug/release package types, and so on. Repetitive tasks should be automated to improve development efficiency.

In order to improve the development efficiency of the industry, cross-platform development has been a tireless pursuit of the goal. There are many attempts in the industry, and this article summarizes them all. In general, the best cross-platform solution is web (H5), at the cost of slightly lower performance.

The advanced

Here’s how to improve your iOS development knowledge.

If self-study ability is strong, it does not need to say more, each of the above points online have a lot of information, such as memory network storage of these computer basic knowledge also have classic books, one by one, as long as the understanding is deep enough, you can become an expert in the field, and it is easy to understand.

However, this kind of learning method will be boring and difficult to practice. I recommend learning in practice. Specifically, it is to constantly find problems -> solve problems in the development process at ordinary times.

Found the problem

First of all, it’s best to be in an environment where there are a lot of engineering problems that need to be solved, so it’s easy to identify them. It’s best to be in one of these types of projects:

  1. Projects in a period of rapid development. Growth will bring a lot of problems, and everything is immature. It is very natural and valuable to solve these problems.
  2. Huge projects, super apps will bring many problems that small and medium-sized apps have not encountered, and because of the large volume, even if only one thousandth of the people encountered will affect hundreds of thousands of people, it is very valuable to solve, there will be a lot of detailed problems.
  3. Projects with special needs, such as those mentioned above, require deep research in one area and naturally encounter many problems.

If it doesn’t happen to be in any of these three types of projects, that’s fine, as long as it’s healthy, there’s always room for problems and improvements. Just develop the awareness to see the problem. A lot of times the problem is there, but no one sees it, and no one thinks it can/should be solved. According to the points listed above, we can ask ourselves whether we can improve the efficiency and quality of related points, such as whether we can improve the efficiency of front and background coordination, whether repeated code can be automatically generated, whether the startup time can be shorter, whether the efficiency of online problem discovery and troubleshooting can be improved, and so on. The questions will cover all the points mentioned above.

If, unfortunately, your project is not healthy, there are no problems or problems that are not worth solving, or if you haven’t graduated yet, here is a universal question: how exactly do well-known open source projects work? Analyze the open source project source can learn many things, all kinds of open source projects also cover a lot of knowledge, as long as deep to study them, study its architecture and coding, don’t understand the place to supplement the knowledge, is also a good way to learn, if can output the effect will be better, after learning of hands-on practice.

To solve the problem

Different approaches to solving problems vary greatly. Here are some common techniques to follow:

1. How did the industry solve the problem? What’s wrong with their plan? How can I do better? Industry has a variety of open source library and technology sharing, as long as the problem is not too wide, most people will have proposed solution, compare and study the existing scheme, see if they can meet the requirements, find out their advantages and disadvantages, and see if I can do better than they are better or more suitable for solving problems.

2. Can the solution be generalized and encapsulated as an open source library for use by other projects? Open source projects all come this way, if you encounter a problem that others have not solved, do not miss the encapsulation of open source library for the benefit of society.

3. Is there any way to prevent similar problems in the future? Some problems may occur repeatedly, and whether they can be prevented or detected and fixed when they occur may involve improvements in development processes, automation and monitoring systems.

4. Can we sum up the methodology (routine) to solve this kind of problems by summarizing precipitation? It is better to output or share articles. The process of writing is a great learning process, because it requires you to articulate vague thoughts and force you to organize your thoughts.

conclusion

According to my understanding, the technical points related to iOS are listed here, as well as a small suggestion to improve the ability in practice. It may not cover all aspects, but it is just for reference. In addition, it is only limited to iOS development. In fact, as a programmer, you should not limit the scope of your learning. If you have time to learn more about the back-end/front-end/operation and maintenance, it will be very beneficial to improve your development ability.

At the end of the article: iOS hot corpus

  • 1.BAT and other large factory iOS interview true question + answer Corpus

  • 2.A must-see book for iOS Mid and advanced Development

  • 3.IOS Development Advanced Interview “resume making” guide

  • (4)The iOS interview process to the basics