IOS Project directory Structure

Source: Internet
Author: User

The directory structure of the IOS project shows your development experience

Recently, a brother interview with iOS development, he was surprised to tell me that the interviewer asked him how to divide the directory structure, but also specifically asked each subdirectory of the file name.

The directory structure is really important, and the interviewer is certainly trying to spy on his development experience. A clear directory structure that allows people to understand the business and functions at a glance, which can also reflect the developer's experience and architectural level.

At the moment, I have been exposed to projects that are more conventional in two structures:
1. Main directory According to the business classification, the internal directory according to the module classification (main directory according to the MVC architecture classification, internal according to the Project module classification)

优点: Relatively fast positioning of the corresponding business.
缺点: module related classes are too scattered, need to switch back and forth to find files, inconvenient to develop.

2. Main directory According to the module classification, the internal directory according to the business classification

优点: Centralize the class of modules to facilitate management and development.
缺点: When several modules share some classes, they are not well categorized.

Suppose to Jane book iOS app Catalog classification (unofficial):

    • 1. Main directory According to the business classification, the internal directory according to the module classification
    • 2. Main directory According to the module classification, the internal directory according to the business classification

注意: The above two categories are not absolute, but also in accordance with business needs to classify. If the company multi-project (refers to the outsourcing company, ha ~), you can try to classify according to their own logic, or you can observe the next side of the project, will learn the mystery. The code is the same, look at the great God write, even can directly imitate the code style of the Great God, others will treat you as the great God!
ps: commented that the Chinese name of the directory notes is lo. Indeed in development, some very experienced programmers do not do so, even in the code are rarely Chinese comments. But personally, ordinary or middle-rank senior engineer really drip is necessary more comments, because of less experience, variable and method names may not be named bad, many with GOOGL translation, and even to review the code can not be literal. Thank you note the advantage is that even if you do not understand the code I write, it will also be able to let you know what it is to do (million, ha ~), convenient and convenient for others! Finally, the directory is not really good or bad points, as long as the application of their own business, is the right directory!

    • IOS Universal Jump Interface Method (runtime utility)-Pinterest-in the development project, there will be such a perverted demand: push: According to the data rules pushed by the server, jump to the corresponding controller feeds list: Different similar cell, may jump different controller (Shh!). The product manager is like this: I'm not sure which interface to jump to Oh, maybe this and maybe that, can you make me flexible? Any jumps based on the background return rule? ) ... Hansha haha? www.jianshu.com→
    • Correct use of iOS macros (define) and constants (const)-Pinterest-in iOS development, it is often used to define macros, or to use const to modify some data types, often developers do not know how to use the correct, resulting in the project of random macros and const decoration can you distinguish between the following? Do you know when to use it? Define Hscoder @ "Hansha haha" nsstring hscoder = @ "Hansha haha"; extern N ... Hansha haha? www.jianshu.com→
    • About IOS: deep. Shallow copy and Copy.strong-Pinterest-Brief introduction: Deep. Shallow copy and Copy.strong deep. Shallow copy copy mutablecopy nsstring nsstring string = @ "Hansha haha"; No new object is generated nsstring copystring = [string copy]; To produce a new pair of ...

IOS Project directory Structure

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.