The design of the project architecture primarily refers to the MVVM+MVC architecture, and is graded with functional modules. The following is the directory structure.
Primary directory:
All we need to do is focus on the directory under the Sgzh folder, other directories managed by Xcode. You can see that this directory is the project's primary directory, and our development process only needs to manipulate the files in the primary directory, which is divided into 3 chunks:
Appdelegate:appdelegate is the program portal, the program start and display logic are defined internally, the main can let the developer quickly find the proxy file and understand the program from boot to display process, also can quickly do some initialization test.
Resource: This directory mainly contains project resource files, such as Project transduction, audio, video, coredata data, etc.
Class: Store The code file we wrote.
Supportingfile: Project configuration file.
Info.plist, MAIN.M, PCH files.
Second Level directory:
Resource directory: A relatively small transduction is placed inside the assets, and the folder is divided into functional modules. If the larger diagram, such as the Start page, the boot page, you can create a new corresponding function module folder in the directory to store. Other audio video files can be created corresponding to the name of the folder to store.
The class directory:
Category: Project classification file.
Macro: Project Global header files, global macros, and constants
Other: Some other configuration files, such as the network request API
Main: Project major files, global shared files, and some base classes
Tool: Project tools such as Web request tool, caching tool, app management tool, etc. Vendor: A third-party library that the project needs to manually introduce.
Sections: Project function module grouping.
Can be divided by the corresponding tab at the bottom tabbar, if there is a login, new features and other relatively large functions, can also be divided into a module. If the sub-modules within the module function more, it can also be divided into a sub-module inside. Each module is divided into 4 folders, respectively, to store the corresponding controller, Model, View, ViewModel. As far as I know, most enterprise iOS projects will pick similar schema patterns. Personally, the architecture is clear, readable, and each module folder is relatively independent, and developers are relatively focused on developing their own modules.
The above for my work on the development of iOS has summarized some of the project architecture experience, if there is insufficient or can be improved to propose changes.
iOS Project schema documentation