Xcode 6 Official Edition How to create an empty application
- |
- Browse:1962
- |
- Updated: 2014-11-05 20:40
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
Example
Run Xcode 6 to create a single View application project.
Once created, remove the Main.storyboard and Launchscreen.xib from the project catalog and throw them into the trash.
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).
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.
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.
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