1. Preface
A clear project directory structure facilitates project development and is also part of the software architecture, so it is important to build the directory structure of the project at the beginning of its development. When I first turned to iOS, I did not know how to build the project directory of the app, after participating in the development of two applications, combined with the web development of the directory used to organize my own directory structure. Share, welcome to the exchange.
2. My project directory structure
Project Directory ├──thirdlib (three-party library) │ ├──sdwebimage│ └──afnetworking├──framework (own packaged class library) ├──general (General category) │ ├── Class (generic class, such as custom parent) │ └──helper (Universal helper method) ├──main (single entry for the program, only appdelegate distinguish other files) │ ├──appdelegate.h│ └── Appdelegate.m├──model (Data Model class directory) │ ├──MACRO (macro definition directory) │ ├──BLL (business Logic Layer directory) │ ├──dal (data Access layer directory) │ ├── Entity (custom entity directory) │ ├──request (Network request class directory) │ ├──location (Location service catalog) │ └──socket (Socket class directory) ├── Module (function module directory) │ ││ ├───modulea│ │ ├──viewcontrollera.h (View Controller header file) │ │ └── VIEWCONTROLLERA.M (View controller m file) │ ├──moduleb│ ├──modulec│ ├──moduled│ └──modulee└──view (view class directory) └──mytestview
3. Description 1) Project directory
The project program file root directory, which holds project program files, resource files, and so on.
2) Thirdlib
Third-party open source libraries such as sdwebimage, afnetworking, etc.
3) Framework
The class library of your own encapsulation.
4) General
A generic class directory that stores custom view controller base classes, and so on.
5) Main
Program single entry, only put appdelegate distinguish other files
6) Model
The Data model class file directory. It is primarily used to store custom data model classes.
Sub-directories:
I) macro (macro definition directory)
I put a lot of my macro definition, including color font, such as style macro definition, business logic macro definition, network request, Core data macro definition and other header files in this directory. The naming convention is XxxMacro.h. This makes it clear what macro definitions I want to introduce when the header file is introduced to avoid duplicate references. (although import has avoided the introduction of files repeatedly when compiling files, but OCD patients.) You know that)
II) BLL (business Logic Layer directory)
The business Logic Layer directory primarily stores the business logic processing classes and classifications of the project. Encapsulate business logic according to project functional requirements. Names are named according to the functional business implemented.
III) DAL (data Access layer directory)
The data Access layer directory primarily stores items. xcdatamodeld files and encapsulated core Data interface classes.
IV) Entity (custom entity directory)
The data Model entity class directory. A class file that holds data models such as user.
V) Request (Network request class directory)
The class directory where the network request is stored.
VI) Location (Directory of service categories)
Store the location service class.
VII) socket (Socket class directory)
Store the socket class.
7) Module
Function Module class directory, create subdirectories according to the project's function module. Each subdirectory holds the view controller file for the module.
8) View
View File class directory. Store the view file. such as the view controls that you encapsulate, the encapsulated cells, and so on.
4. Summary
1) Spit out the document editing of the blog park. When I wrote the HTML pattern, I accidentally canceled the order ... Then all the wood has ... All the wood has ... The wood has ... Have a ... ...!!!!!! Sister Ah!! Why cancel the key on the right AH!!!! Then Command+z ... The page is all crashing .... All the faces were broken .... It all collapsed .... It all collapsed .... Part of the crash. Collapsed .... The collapse of .... .....!!!!!! In addition, the blog input text plug-in content area height is too small ... It's very uncomfortable to use,!!!!!!. The experience is too poor! Bad reviews
2) to the end, my directory structure is a combination of previous development experience and my leader development habits and the online directory structure, and does not necessarily apply to other projects. Welcome message exchange, thank you ~
iOS Development Summary-project directory structure