I am using a theme in my application and I came across a strange error (function?). For some odd reason, I can't use UIView.animate in my custom UITabBarController class to animate the color change of my UITabBar, but the same exact code works fine in the custom class of my UINavigationController.
Am I missing something? Is there anything else I can use to animate color changes? I looked at Apple docs but found nothing.
Here is the code that I use 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 }) } }
ios animation swift uitabbarcontroller uinavigationcontroller
cyril
source share