更新时间:2023-11-30 17:11:16
您可以根据 if/else 条件使用您的 ViewController 创建一个 UINavigationController 对象,并将导航控制器设置为 AppDelegate 中窗口的 rootViewController 属性,如下所示:>
You can create an object of UINavigationController with your ViewController as per if/else condition and set the navigation controller as rootViewController property of window in AppDelegate as follows:
LoginViewController *loginController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"loginController"]; //or the homeController
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:loginController];
self.window.rootViewController = navController;