Source code

IOS Component Development Implementation Phase I Document

 image.png

Component development series:
(1) Reflection on the design of iOS component-based development architecture
(2) IOS Component Development Implementation Phase I Document

1、 Objectives

Sort out the project engineering structure and remove the foundation layer and intermediate layer.

Ensure that all third-party library management and basic libraries are extracted from the main project and can be compiled independently to reduce compilation time.

Sort out the functions and usage methods provided to facilitate the invocation of various business modules.

Let team members become more familiar with the company's projects, reduce repeated wheel building, and improve development efficiency.

2、 Implementation plan

1. Implementation instructions

  1. Set up a componentized branch group, a componentized main branch and multiple change branches. The main branch of componentization, on a weekly basis, reviews and consolidates the use of code, marks tags and submits tests so that changes can be released with the version. It is recommended that special personnel be responsible for control.

  2. Every time, small steps are taken to change and change the simplicity (such as adjusting the file path, changing the project name, changing the Pods, etc.), and timely compilation is made to verify whether the changes are correct, and submitted after success.

  3. Try to make adjustments without changing the code logic. For major changes, such as modifying logic, moving a library to another project, changing Pods, and deleting some files, you can make some records or give detailed instructions when submitting code for problem review.

  4. When moving files, pay attention to changes in the file environment MRC/ARC. If necessary, try to change it to ARC.

2. Project engineering definition

The preliminary adjustment of the project directory structure is as follows:

Basic layer and intermediate layer

Pods : Only third-party libraries managed by Pods.
DDManualThirdSDKs : A third-party library that cannot be managed by Pods. The third-party library should be encapsulated as necessary, centralized into a private library, and then handed over to Pods for management.
DDDevelopLib : Self encapsulated private libraries, such as system class classification, data processing classes, general UI components, macro definitions, constant definitions, etc. Make a private database and submit it to Pods for management.

Business component layer

DDEngine : Later, the model will be standardized into specific modules. Some files need to be extracted to the base layer or middle layer, while others remain unchanged temporarily. Later, the encapsulated network library will be extracted.
DDMIX_UI : temporarily reserved, belonging to the third phase.
ddDemo : Drop the third-party library, UILib, classification, etc. out of the base layer or middle layer, and keep them unchanged for the time being.

Common directory structure of foundation layer and middle layer engineering

DDManualThirdSDKs: project code

CoreCode: core code
Resources: required resource files.
SupportingFiles:. pch,. plist, etc.

Frameworks: Dependent system libraries.
Products: compiled. a file.
Pods: pods configuration file.

fabulous ( zero )

This article is written by Contributors Author, article address: https://blog.isoyu.com/archives/ioszujianhuakaifashishiyiqiwendang.html
use Knowledge Sharing Attribution 4.0 International License Agreement. Unless the reprint/source is indicated, they are all original or translated by this website. Please sign your name before reprinting. Last editing time: May 24, 2019 at 06:27 PM

Popular articles

Post reply

[Required]

I am a human?

Please wait three seconds after submission to avoid unsubmission and repetition