我想在应用程序委托中设置rootViewController ..
func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { var rootView: MyRootViewController = MyRootViewController() //Code to set this viewController as the root view?? return true }
你可以这样做。
func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { var rootView: MyRootViewController = MyRootViewController() if let window = self.window{ window.rootViewController = rootView } return true }