0

appdelegateのすべてのスタックを表示コントローラとして表示する方法を教えてください。
TabBarContollerはrootviewcontollerです。
TabBarControllerに4つのタブがあり、それぞれがnavコントローラです。
私はこのようにviewcontrollerを提示する必要があります。 tabBar => navBar => mainViewContoller => aViewController => bViewController;
そして、私はmainviewcontrollerに戻るか、タブバーでナビゲートするために使用できるはずです。AppControllerからView Controllerを表示する方法TabBarController => NavbarController

私はストーリーボードを持っています。

私は同様の質問で推薦された多くのソリューションを試しましたが、それは助けになりませんでした。

答えて

0
TabBarController * tabBar = (TabBarController *)[UIApplication sharedApplication].delegate.window.rootViewController; 
        if([tabBar isKindOfClass:[UITabBarController class]]){ 
        [tabBar setSelectedIndex:0]; 
        UINavigationController * navBar = (UINavigationController *)tabBar.selectedViewController; 
        UIViewController * currentVC = navBar.topViewController; 
        [currentVC performSegueWithIdentifier:@"notificationSegue" sender:nil]; 
0

これはストーリーボードでのみ実装する必要があります。

私はappcodaを使ってサンプルプロジェクトを試しました。それを成功させました。私はあなたにストーリーボードのデザインを示します。

enter image description here

enter image description here

これは、複数のビューコントローラを使用して実施しています。

+0

おかげで、あなたを必要とするが、私はプッシュして、すべてのものと特定のViewControllerをappdelegateから現在必要なものは何でもタブに

self.window = UIWindow(frame: UIScreen.main.bounds) let storyboard = UIStoryboard.init(name: "Main", bundle: nil) let viewController = storyboard.instantiateViewController(withIdentifier: "TabBarControllerID") as! UITabBarController viewController.selectedIndex = 3 self.window?.rootViewController = viewController self.window?.makeKeyAndVisible() 

変更selectedIndexの値。 –

+0

その後、ストーリーボードではなくxibと一緒に行かなければなりません。 – user3182143

0

私はこれがすべてのあなたのために役立つと思いました。私は、同様のプロジェクトを設定している、LoginViewcontroller - > TabBarController(5つのタブ) - >各タブのNavigationController - >その他ViewControllersは

はストーリーボードでは、私は私のTabBarController

はAppDelegate(didFinishLaunchingWithOptions)内

私は追加ストーリーボードIDを与えましたあなたのコメントを

関連する問題