Closed markst closed 7 years ago
In conjunction with the following code:
extension FittingViewController: TabsControllerDelegate {
fileprivate func updatePaddleColour(selected index: Int) {
if let status = self.testResultViewController?.test?.testStatus {
if [TestStatus.failedUnknown.rawValue,
TestStatus.failedBattery.rawValue,
TestStatus.failedLamp.rawValue,
TestStatus.failedControl.rawValue].contains(status) {
if index == 1 {
self.pageController?.tabBar.lineColor = UIColor.cs_Thunderbird()
} else {
self.pageController?.tabBar.lineColor = UIColor.cs_Citron()
}
} else {
self.pageController?.tabBar.lineColor = UIColor.cs_Citron()
}
}
}
// MARK: - TabsControllerDelegate
func tabsController(tabsController: TabsController, didSelect viewController: UIViewController) {
let selectedIndex = tabsController.viewControllers.index(of: viewController)!
self.updatePaddleColour(selected: selectedIndex)
}
}
@danieldahan I prefer the previous setup. Perhaps it's worth discussing with @OrkhanAlikhanov as to workarounds?
I reopened the issue #860. So I will close this as they are now linked.
@markst I haven't updated to the latest Material yet. I still have some pods that don't support swift 4.
As mentioned here: https://github.com/CosmicMind/Material/issues/860#issuecomment-337090396
Previously I was able to set the states for tabItem's as follows:
However since the introduction of https://github.com/CosmicMind/Material/releases/tag/2.12.0 I am no longer able to set the highlight state of my tab bar items.
This goes beyond where by I was previously able to update tab bar state individually such as:
This would enable different button states based on their selection. Producing appearance such as: