简体   繁体   English

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

[英]How to create an empty ios project in 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? 我正在使用xcode 6,在创建新项目时,它们不再具有“空项目”选项,只有一个视图...是否有获取它的选项,否则它就消失了,我需要处理吗?

Thanks a bunch 谢谢一大堆

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). 删除情节提要,并在Info.plist中删除对该情节提要的引用(这样就不再有主要的情节提要)。 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. 现在,就像在Xcode 5中一样,在应用程序委托的application:didFinishLaunchingWithOption:从头开始做所有事情。

I'm using Swift these days, so I'll show you what a pure code app delegate launch looks like in Swift; 这些天我正在使用Swift,因此我将向您展示Swift中纯代码应用程序委托启动的样子。 I'm sure you can translate into Objective-C: 我相信您可以将其翻译成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
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM