Write an IOS application, the project structure can be like this...

I will briefly introduce the project structure that I used when doing iOS projects. The first thing to say is that this is just my project structure, not a specification. Maybe it has many problems and irregularities. I just share it to provide you with a reference. I also hope to receive some feedback from you. Help me improve!

        The following figure is a common engineering structure for my iOS project. The overall model is still in accordance with the MVC structure, but some subdivision processing is done at each layer. The following is a brief introduction.

  1.png


Application: AppDelegate and some system constants and system configuration files are placed in this group;

Base: Some basic parent classes, including the parent ViewController and some public top-level custom parent classes. The classes of other modules generally inherit from some of these classes;

Controller: System control layer, where ViewController is placed, all inherited from BaseViewController or BaseTableViewController in Group Base;

View: In the view layer of the system, since I prefer to implement the interface through code, all views are inherited from UIView. I separate the views from the ViewController and put them here, so as to keep the ViewController streamlined;

Model: The entity in the system, which describes some roles and businesses in the system through classes, and contains the processing logic corresponding to these roles and businesses;

Handler: System business logic layer, responsible for processing complex business logic of the system, the upper caller is ViewController;

Storage: Simple data storage, mainly the storage of some key-value pairs and the access to external files of the system, including the packaging of NSUserDefault and plist access;

Network: The network processing layer ( RTHttpClient ), which encapsulates the AFNetworking-based network processing layer, realizes the callback of the processing result through the block, and the upper caller is the Handler layer;

Database: Data layer, which encapsulates the SQLite database access and management ( RTDatabaseHelper) based on FMDB , provides an external call interface based on Model layer objects, and encapsulates data storage procedures.

Utils: System tools ( AppUtils ), which mainly place some common system tools;

Categories: categories, extensions to existing system classes and custom classes;

Resource: Resource library, including pictures, plist files, etc.;


Guess you like

Origin blog.csdn.net/qq_27740983/article/details/51444096