My IOS Engineering directory structure __ios

Source: Internet
Author: User
Tags java web

The following are personal insights, please point out any inappropriate places.

Have done Java Web work before the development of iOS, and have a more profound understanding of the structure and layering of the project directory. Whether it is a three-tier or seven-tier Java division, the main purpose is to project readability, maintainability, to facilitate the developer, of course, I have also been facilitated. So in the development of iOS applications, it is very natural to think of the engineering directory structure.

The iOS directory you see in Xcode is a logical subcontract, and if you don't differentiate between actual folders, even the directory you see is layered, but when you open the folder where the project is located, all files are found under the project's folder. I used to create folders under the iOS Engineering directory and then drag folders to Xcode to introduce them, so the actual engineering directory and Xcode can be seen in the one by one correspondence.

As shown in the following illustration (the actual hierarchy of the item in the folder, the red cover is the name of the project):


Hierarchy of projects in Xcode:


Here is an introduction to each directory:

First, Model:

The directory holds the data model, which is the entity class that the business needs. You can set up a different business folder under it as needed, and then store the related entity classes under the folder. As follows:


The model directory below stores the "login" related and "my information" related to the logic of the directory, and then the respective directories to store the corresponding entities.

Second, network:

The network processing layer, the Afnetworking network request carries on the encapsulation again, uses the block or the proxy form to carry on the network return data processing. Used in Viewcontroller or ViewModel calls.

Iii. Resources:

Resource file directory, I mainly store pictures such as @2x, @3x pictures. According to the actual situation, as in the model directory, the following set up a different module folder, and then under the corresponding module to store pictures.

Four, Viewcontroller:

Business logic control layer, store Uiviewcontroller and related control class. In general, as in the model directory, the following set up a different module folder, and then under the corresponding module to store the corresponding control classes. Such as:


Five: Common:

Store third party libraries, write your own Help classes, and customize the UIView. such as: Fmdb, Sdwebimage, Jpush, afnetworking, Helpclass, widgets, etc.:


VI: appdelegate:

Create a group that is automatically created by the project, storing related files such as Appdelegate,. plist,. Strings.


Seven, ViewModel:

The module was last, not to say that he was unimportant; the front is used by MVC, and ViewModel is mainly used in MVVM. Like model, you can set up a different business folder under it as needed:



The above structure is to be summed up in the project, many of them are borrowed from the Androi, the purpose of only a better use more clearly understand. Of course, different people have different opinions and hope to communicate.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.