0

enter image description here

I'm making Onboarding and Main in Swift Storyboard environment.

Onboarding = Navigation Controller, welcome and sign up

Main = Tabber Controller, application main function

The order in which the user experiences the application is

  1. Onboarding screen output on first run
  2. When onboarding is complete, the Main Tabbar screen is displayed.

With this in mind, I applied "Is initial View Controller" for onboarding in the storyboard and printed the Main Tabbar in step 2, but the screen appeared, but the bottom tab bar was not displayed.

The next step is to check whether the application is running for the first time in the tabA ViewDidLoad situation of the Main Tabbar, and if it is the first time, execute Onboarding. Otherwise the default tab bar was launched. Onboarding was output by push, but the first screen appeared, but the push to the next screen did not proceed.

let navController = UINavigationController(rootViewController: introVC)

It worked fine when I ran it like this. But because the tab bar covers the screen

self.hidesBottomBarWhenPushed = true

hide the bottom tab bar

I used pop to get out. I personally don't know if this is correct, but it worked. But I don't know where to put the thing that makes the bottom tab bar visible again when the pop is finished.

If Onboarding is navigationController and Main is TabbarController, how should I connect the two?

KimJitae
  • 139
  • 11
  • Does this answer your question? [when need to switch the rootViewController](https://stackoverflow.com/questions/70888593/when-need-to-switch-the-rootviewcontroller) – Ptit Xav May 11 '22 at 09:16
  • I use UINavigationController as root controller, hide navBar and use `setViewControllers:animated:` instead of switching window's `rootViewController`. I have seen issue that `viewWillAppear/Disappear` wasn't called in window's case. – Cy-4AH May 11 '22 at 10:09
  • @Cy-4AH Are you talking about the pageview controller? Looks like it's worth a try. i will try – KimJitae May 11 '22 at 10:45
  • try to change the rootViewController by adding a method in appDelegate that changes the rootViewController after user's done with onBoarding. or put navigationController in the rootViewControler and then change the navigationController RootController by using the setViewController method – Farhandika May 11 '22 at 15:32

0 Answers0