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