如何在Xcode 6中创建一个空的ios项目?

如何在Xcode 6中创建一个空的ios项目?

问题描述:

我正在使用xcode 6,在创建新项目时,它们不再具有空项目"选项,只有一个视图...是否有获取它的选项,否则它就消失了,我需要处理它吗?

i'm using xcode 6 and they no longer have the "empty project" option when creating a new project, only a single view one...Is there an option to get it or it's gone and I need to deal with it?

感谢一堆

您需要处理它,但这很容易.从单视图"应用程序开始.删除情节提要,并在Info.plist中删除对该情节提要的引用(这样就不再有主要的情节提要).如果愿意,也可以删除视图控制器类.现在,就像在Xcode 5中一样,只需在应用程序委托的application:didFinishLaunchingWithOption:中从头开始做所有事情.

You need to deal with it, but it's easy. Start with the Single View application. Delete the storyboard and delete the reference to it in the Info.plist (so that there is no longer a main storyboard). If you like, delete the view controller class as well. Now just do everything from scratch in the app delegate's application:didFinishLaunchingWithOption:, just as you did in Xcode 5.

这些天我正在使用Swift,所以我将向您展示在Swift中纯代码应用程序委托启动的样子.我相信您可以将其翻译成Objective-C:

I'm using Swift these days, so I'll show you what a pure code app delegate launch looks like in Swift; I'm sure you can translate into Objective-C:

import UIKit

@UIApplicationMain
class AppDelegate : UIResponder, UIApplicationDelegate {
    var window : UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        self.window = UIWindow(frame:UIScreen.mainScreen().bounds)
        self.window!.rootViewController = ViewController() // or whatever you call it
        self.window!.backgroundColor = UIColor.whiteColor()
        self.window!.makeKeyAndVisible()
        return true
    }
}