我刚刚将.m文件更改为.mm并使用C++.有没有办法用Swift做同样的事情?
在XCode 6中创建新项目不允许禁用Storyboard.您只能选择Swift或Objective-C并使用或不使用Core Data.
我尝试删除故事板,从项目中删除主故事板,并从didFinishLaunching手动设置窗口
在AppDelegate中我有这个:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow
var testNavigationController: UINavigationController
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
testNavigationController = UINavigationController()
var testViewController: UIViewController = UIViewController()
self.testNavigationController.pushViewController(testViewController, animated: false)
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window.rootViewController = testNavigationController
self.window.backgroundColor = UIColor.whiteColor()
self.window.makeKeyAndVisible()
return true
}
}
Run Code Online (Sandbox Code Playgroud)
但是,XCode给了我一个错误:
类'AppDelegate'没有初始值设定项
任何人都成功了吗?