Build-to-distribute IOS projects

Source: Internet
Author: User

This article focuses on the first step in opening a new project: from building a project to developing a team distribution module. Now the virtual one is going to start the project called:Newstart (New start), through this project you can see the entire project directory structure.

The main framework is designed as follows:

Recommended to download the completed code, in fact, you can directly see the code, you can not read this article, here is not the whole, which also has a lot of nonsense, my statement also some problems. After all, one line of code is better than words. After downloading the code, remember to install the pod before you run it. Because the code has been updated, so this article is mainly in Git's second node to do the introduction: The first time the project was submitted, the main completion of the project to distribute.

Next, you will follow the steps in turn.

First, git ready

At the beginning of the work that will always use SVN for code management, starting in 17 to use Git, this time using GitHub to introduce. In general, companies will have their own git servers. Specific steps:

1, the first need to have a project team (group), generally in the company as a unit. For example XXXX Company's project, should be in a group. Even if the company has only one project, it should be a separate group.

2. Create a project in the specified project group, and an empty Git project without any branches has been completed.

3, through the 2nd step to create a git project, you can directly on the page to the readme.md file also created.

4. Clone the project to local and add an ignore file (. gitignore)

The above is the general step of Git at work, now using the GitHub process to go through, the process is consistent, the only difference is a group, called Team, is actually the same.

Create a team in your own account:

This is the way the team was created successfully.

To start creating a project:

This is how the project was created successfully:

So far, a git remote repository is ready, and we're going to clone directly to the local, and that's the way it ends up:

So far, all the preparations for a git have been completed. In fact, the process is very simple, it can be said that no time can be completed.

Ii. Creation of the project

This is the case when you finish creating the project in Xcode:

The first to change the system minimum support version of the project:

So far, a simple project is over, can you submit a remote to your colleagues to start developing now? That must not be possible, but also very far away, now just have a project, but also need to be a simple framework to get out, or other colleagues will be very messy. At least we need to take 3.

Complete:

1, the overall structure of the project and commonly used base class

2. Third party

3. Network Framework

These three points may not be the final version, but must have, after all, team cooperation development must have a direction, otherwise different people will definitely make their own set, so it is not possible. The following are based on the above 3 points respectively.

1, the overall structure of the project and commonly used base class

Directory minor Changes

Add Supportingfiles Directory

In the new version of Xcode there is no supportingfiles, but accustomed to this file, we can make one ourselves. Mainly used to put assets.xcassets, Info.plist and main.m these three files into this directory.

It is important to note that the value of the Infoplist_file in the Project.pbxproj file will be changed in the file because the path to the Info.plist file is changed.

Add Appdelegate Directory

Place the two. h and. m files of the appdelegate into this folder separately.

And now it looks like this:

In Xcode, the catalog looks like this:

This seems to be relatively simple and clear, I feel, in fact, so far, just made a small adjustment, there is no real construction project structure.

Add General Directory

This directory is a core directory and all the code will be here. This directory also has these directories: Libs (used for non-Pod managed third party libraries), category (category), Modules (all modules of the project), Macro (basic configuration, such as network, base class). Such as:

In fact, in the above directory of the Libs and Category can be allowed to empty files, specifically in the development process can be used to add. But modules and macro as far as possible to fix.

Macro Catalogue Perfect

In this directory, the general storage is fixed, even if you want to change, the changes will not be too big, or even if you want to change the kind of global changes. The final result is as follows:

In fact, through the picture will be able to know that this is written in some of the basic configuration of the foundation. In other words, almost all projects can be generic, even if the changes are not too big.

Modules Catalog Complete

This directory is the core requirement of the project. Specific to how to build the directory, it depends on the actual structure of the project.

such as this:

2. Third party

Typically, you use CocoaPods to manage third-party code.

That is true:

Or just drag someone else's code directly into the project, like this:

3. Network Framework

Network framework, why must first be ready?

Anyway, when I first started knocking on the code, our new project was not, and then everyone in the team had the lead, and the network request of a project should be a routine, otherwise it would be messy at the end.

When working with colleagues, add their own interfaces right here:

Create your own categories with your own modules/functions, so items don't get messy.

So far, a simple project build is complete, and you can submit your local code directly to the remote to tell the team to start developing. Remember to create a develop branch.

Just download the code code here, download the code, and remember to install the pod before you run it. Because the code has been updated, so this article is mainly in Git's second node to do the introduction: The first time the project was submitted, the main completion of the project to distribute.

Build-to-distribute IOS projects

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.