Xcode 6 or later how to create an empty project (empty application)

Source: Internet
Author: User

There is no empty application template in the official version of Xcode 6, which is not used by programmers who are accustomed to writing a UI interface with pure code.

One of the best ways to do this is to copy the templates from the Xcode 6 beta version to the past.

But what if you've completely removed Xcode 6 beta and can't find the empty application template download online? You don't have to re-run a few g of Xcode 6 beta again?

Workaround:

1. Run Xcode 6 to create a single View application project.

2, after the creation, the project directory under the Main.storyboard and Launchscreen.xib deleted, thrown into the wastepaper basket.

3, open info.plist, put Launch screen interface file base name, and main storyboard file base name two items, delete (click the minus sign next to it).

4. Open the Project properties file, click the first item below target, then select the General tab and find the Use Asset Catalog button down. Click on it.

5, Pop-up dialog box, click Migrate can. This way, the size of the application can be adjusted according to the size of the screen.

6. Finally, add the necessary code before the "return" statement in Appdelegate's first method.

The code has only 3 sentences, which is equivalent to 3 steps away. 1. Create window;2. set window background; 3. make window visible.

The syntax for OC and Swift is slightly different, but the code content is basically the same.

The code that OC needs to add

Self.window = [[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]];

Self.window.backgroundColor = [Uicolor Whitecolor];

[Self.window makekeyandvisible];

Code that Swift needs to add

Self.window = UIWindow (Frame:UIScreen.mainScreen (). Bounds)

Self.window.backgroundColor = Uicolor.whitecolor ()

Self.window.makeKeyAndVisible ()

After finishing the manual, text image Baidu experience copied, this is I carefully selected, do not look for other.

Xcode 6 or later how to create an empty project (empty application)

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.