Note: This is my own view of the project structure of iOS development for many years, and also create template structure for iOS project developed by the company, introduce the interface architecture of Sina Ios-iphone client, but I am not SINA staff, Just according to their own understanding of the project structure, welcome to put forward different views,[email protected], Welcome reprint, reproduced when please keep all the content of the article, thank you.
This article back to the occasional update ...
Project structure GitHub address: https://github.com/Shreker/QLProjectDemo.git
In order to create a code template that is very readable, maintainable, and extensible for the project code, the builders of the project code are now required to follow these steps:
1. All new projects are best "single View application":
2, fill out the various projects, here note, the project name is best to use English:
3. Once the project is created, the first thing to do is to modify the target version of the minimum deployment system:
4, Next is the source file management, we look at the left navigation area:
- All non-code source files are moved to "supporting files";
- Select Appdelegate and Viewcontroller. h and. M, right-"show in finder", then move Appdelegate and Viewcontroller. h and. M to the trash, back to Xcode, Delete the red file we deleted just now;
5. Import the project structure we have prepared to the table of contents:
,
The result is this:
6, where the folder ' Qlclasses ' is the project of all the source code, ' qlresources ' is stored in all non-code resource files, the following two folders of the structure of the current structure of Sina Weibo detailed description:
- The overall frame diagram is as follows:
- Need to note is the image processing, in ' qlresources ' has a ' qlimages ' folder, this folder is for special image files set up, you can not put all the pictures are here, this unscientific. preferably in the assets.xcassets;
- The project will certainly encounter multiple interfaces using the same data model problem, it is best to create two folders ' Qlcommonmodel ' and ' Qlcommonview ' two folders in the ' Qlmain ' folder for unified management;
- Each folder in the structure you see in the left navigation of Xcode must be mapped to a folder in the Finder, so that without opening the project, we can quickly locate the location of the previously written tool class and easily view the structure of the current project in the Finder.
iOS New Project specification