问题:我有一个 tabViewController,其中包括四个选项卡,第一个选项卡是 homeViewController ,其中包括 sideMenuViewController。现在我想在 tabViewController 之前添加 loginViewController,这只是一次登录。当前。我的应用程序在没有 loginViewController 的情况下正常工作,以下是AppDelegate.m 类中的以下代码。
Now I want to include loginViewController before the tabViewController
请建议我在我的 AppDelegate.m 中进行必要的更改
AppDelegate.m
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
tabBarController = (UITabBarController *) self.window.rootViewController;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
MFSideMenuContainerViewController *container = (MFSideMenuContainerViewController *)tabBarController.viewControllers [0];
NSParameterAssert ([container isKindOfClass: [MFSideMenuContainerViewController class]]);
// UIViewController *historycontr=(UIViewController *)tabBarController.viewControllers[2];
// UIViewController *hist=[storyboard instantiateViewControllerWithIdentifier:@"historyController"];
UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"navigationController"];
UIViewController *leftSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:@"leftSideMenuViewController"];
UIViewController *rightSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:@"rightSideMenuViewController"];
[container setLeftMenuViewController:leftSideMenuViewController];
[container setRightMenuViewController:rightSideMenuViewController];
[container setCenterViewController:navigationController];
return YES;
}