I'm implementing a theme in my application and I ran into a weird bug (feature?). For some odd reason, I can't use UIView.animate
in my custom UITabBarController class to animate a change in color of my UITabBar but the same exact code works perfectly in the custom class of my UINavigationController.
Am I missing something? Is there something else I can use to animate the color change? I've scoured the Apple Documents but found nothing.
Here is the code I'm using in both cases:
class customNavigationController: UINavigationController {
@IBOutlet weak var navBar = ThemeManager.navigationbar
func dusk(notification: NSNotification) {
UIView.animateWithDuration(1, animations: {
self.navBar?.barTintColor = UIColor(red: 79/255, green: 79/255, blue: 79/255, alpha: 1)
self.navBar?.barStyle = UIBarStyle.Black
})
}
}
And:
class customTabController: UITabBarController {
@IBOutlet weak var tab = ThemeManager.tabbar
func dusk(notification: NSNotification) {
UIView.animateWithDuration(1, animations: {
self.tab?.barTintColor = UIColor(red: 79/255, green: 79/255, blue: 79/255, alpha: 1)
self.tab?.barStyle = UIBarStyle.Black
})
}
}