Xcode 6.1 Official Edition How to create an empty application

Source: Internet
Author: User

Xcode 6 Official Edition How to create an empty application
    • |
    • Browse:1962
    • |
    • Updated: 2014-11-05 20:40
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
Step through Reading

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.

There are netizens to give a solution is to the Xcode 6 beta version inside the template copied 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?

This article describes the full version of Xcode 6, How to change a single View application to your familiar empty application. This method is applicable to OC and swift language development.

Tools/Materials
    • Xcode 6 Official edition
Example
  1. Run Xcode 6 to create a single View application project.

  2. Once created, remove the Main.storyboard and Launchscreen.xib from the project catalog and throw them into the trash.

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

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

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

  6. Finally, in the first method of appdelegate, add the necessary code before the "return" statement.

    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 ()

    END

Xcode 6.1 Official Edition How to create an 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.