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

Copy tabBarItem when embedded in TabBarController #35

Merged
merged 1 commit into from
May 6, 2022
Merged

Copy tabBarItem when embedded in TabBarController #35

merged 1 commit into from
May 6, 2022

Conversation

Patrick-Kladek
Copy link
Contributor

Description

When ViewControllerHost is added to a UITabBarController its tabBarItem is missing/no icon is shown in the TabBar.

Tasks

  • Copy tabBarItem on reload

Infos for Reviewer

Here is my setup. I changed line 3 and added Inject.ViewControllerHost(...) which resulted in a missing tabBarItem (first image).

let tabBarController = UITabBarController()

let homeVC = Inject.ViewControllerHost(HomeViewController(app: self.app, dependencies: self.dependencies))
let homeNavigationVC = UINavigationController(rootViewController: homeVC)
homeNavigationVC.navigationBar.prefersLargeTitles = true

tabBarController.viewControllers = [homeNavigationVC, ...]

After my changes the tabBarItem correctly appears (2nd Image).

Result

@Patrick-Kladek
Copy link
Contributor Author

Wrapping the UITabBarController inside ViewControllerHost does not work for me. I get a black screen after changing the source of HomeViewController. Maybe thats related to my setup with async/await. It works perfectly in this example with this changes.

@krzysztofzablocki krzysztofzablocki merged commit fff24e3 into krzysztofzablocki:main May 6, 2022
@krzysztofzablocki
Copy link
Owner

thanks 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants