Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tab and push to current navigation stack #109

Open
projectfebr opened this issue Dec 2, 2024 · 5 comments
Open

Change tab and push to current navigation stack #109

projectfebr opened this issue Dec 2, 2024 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@projectfebr
Copy link

projectfebr commented Dec 2, 2024

Hello! Need help.
UITabBarController with two tabs: main page and catalog.

Let's say the current stack of controllers in the catalog is:
UINavigationController -> MainCatalogController -> CatalogController -> CatalogController.

While on the main tab, I need to go to the catalog tab, create a new SearchViewController and push it to the catalog navigation stack.

I didn't find anything like this in the example

@projectfebr projectfebr changed the title Change tab and push to current navgiation stack Change tab and push to current navigation stack Dec 2, 2024
@ekazaev ekazaev self-assigned this Dec 3, 2024
@ekazaev
Copy link
Owner

ekazaev commented Dec 3, 2024

@projectfebr Hi

Would love to help but I need a bit more details.

First, SearchViewController. Is it a standalone view controller or you want to present UIKits default UISearchController within CatalogController.
Second, what are the requirements for presentation? Should it be presented just latest in the UINavigationController that is in the catalog tab?

@ekazaev ekazaev added the help wanted Extra attention is needed label Dec 3, 2024
@projectfebr
Copy link
Author

  1. SearchViewController: UIViewController, my custom class, its for example.
  2. The hierarchy should be like this: UITabBarController[catalog] -> UINavigationController -> MainCatalogController -> CatalogController -> CatalogController -> SearchViewController

@ekazaev
Copy link
Owner

ekazaev commented Dec 4, 2024

@projectfebr
Who is building the second step? Basically what I ask is do you already have UITabBarController[catalog] -> UINavigationController -> MainCatalogController -> CatalogController -> CatalogController built and just want to switch the tab and push SearchViewController? Or there is something more complex? Because if you just want to push and switch the tab its enough to write .from(GeneralStep.custom(using: ClassFinder<MainCatalogController, Any?>()).expectingContainer())

@ekazaev
Copy link
Owner

ekazaev commented Dec 17, 2024

@projectfebr Any update?

@projectfebr
Copy link
Author

projectfebr commented Dec 17, 2024

@ekazaev sorry. I need to switch the tab, create SearchViewController and push it to the navigation stack without changing all other VCs.

This .from(GeneralStep.custom(using: ClassFinder<MainCatalogController, Any?>()).expectingContainer()) variant removes all VCs that were above MainCatalogController.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants