Understanding How to Add a TabBarController to a NavigationController

Asked 2 years ago, Updated 2 years ago, 73 views

Thank you for your help.

I am currently developing iOS, but I would like to display some screens in Tab format.
The flow is
NavigationController->MainViewController->TabBarController

I would like to do so.
However, if you load TabBarController on NavigationController Stack,
There was an opinion that the Navigation Item configuration added in ViewController was not reflected.
I would like to use NavigationItem, but is there a way to express Tab in this case?

ios swift uinavigationcontroller

2022-09-30 20:29

1 Answers

Instead of using TabBarController, I think it would be good to install several unique UIButton in the footer of the MainViewController and switch views.
The view element is

■ MainViewController.view
con containerView
 t tabPageFirst
 ttabPageSecond
ttabMenuView
 t tabBtnFirst
 ttabBtnSecond

Create a view like
For example, tabBtnSecond is pressed for action

self.containerView.bringSubviewToFront(tabPageSecond)

So how about switching to the front to make something similar?


2022-09-30 20:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.