Closed AbdelrahmanShehab closed 1 month ago
Hello @AbdelrahmanShehab !
You haven't any limitations of how you could present your own view corrntrollers. This TabBar display the bottom bar ui but not store or manage your UIView or UIViewController where it will be displayed, this is your own responsability.
In this way, you have a lot of options, one of them could be listen the didSelect method and present a view Controller when it its fire:
tabBar.didSelectTab.sink { event in
switdch event {
case let .didSelect(index):
self.view.background = self.colors[index]
self.presenter(MyViewController(), animated: true) // <<< Present a new view controller over current one
case let .willSelect(index):
UIView.animate(withDuration: 0.3) {
self.view.backgroundColor = self.colors[index]
}
}
}
.store(in: &cancellables)
How to make visible TabBar in all the controllers like UITabbarController works?
As I comment, this animated tabbar it's a uiview only so you could implement the behaviour you want in the way on your own.
For example you could build your own UIViewController with this tabbar in it, and mount the childs view controllers that you want to present as a childs views of it (using addChild and addSubview methods).
I close this issue due to are doubts about how to integrate and deploy view controllers and not by the component itself :).
how to present UIViewControllers for
select
,didSelect
andwillSelect
functions?