You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we're in View Controller 3 and by tapping on the same tab (Tab 1) again, I will now take back to View Controller 1 (the first view-controller in navigation controller hierarchy).
To achieve this, I've made a slight change in on tab tapped closure block:
hhTabBarView.onTabTapped = { (tabIndex, isSameTab, controller) in
if isSameTab {
if let navcon = controller as? UINavigationController {
navcon.popToRootViewController(animated: true)
} else if let vc = controller as? UIViewController {
vc.navigationController?.popToRootViewController(animated: true)
}
}
print("Selected Tab Index:\(tabIndex)")
}
With this, there'll be a possible highlight issue will occurs as part of this change in 2.3.0, to fix this:
I am suggesting this solution: Integrate this functions in View Controller 1 (and all other where you will have similar navigation flow).
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// This will be helpful in locking the current tab if we're already in the first view-controller in navigation flow.
HHTabBarView.shared.lockCurrentTab()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// This will be helpful to unlock the locked tab when we're going forward from the first view-controller in navigation flow.
HHTabBarView.shared.unlockAllTabs()
}
P.S. Thanks Nishan for coming up with this issue. 🙏🏼
The text was updated successfully, but these errors were encountered:
Tab 1 ↠ Navigation Controller ↦ View Controller 1 → View Controller 2 → View Controller 3
So we're in View Controller 3 and by tapping on the same tab (Tab 1) again, I will now take back to View Controller 1 (the first view-controller in navigation controller hierarchy).
To achieve this, I've made a slight change in on tab tapped closure block:
With this, there'll be a possible highlight issue will occurs as part of this change in 2.3.0, to fix this:
I am suggesting this solution: Integrate this functions in View Controller 1 (and all other where you will have similar navigation flow).
P.S. Thanks Nishan for coming up with this issue. 🙏🏼
The text was updated successfully, but these errors were encountered: