I want to change the UI Tab Bar Icon colour to the values: Red: 0.75, Green: 1.0, Blue: 1.0, Alpha: 1.0 and to white when the Icon is not selected.
Till now I thought this is how you do it:
UITabBarItem.appearance().finishedSelectedImage([NSForegroundColorAttributeName: UIColor(red: 0.75, green: 1.0, blue: 1.0, alpha: 1.0)], forState: UIControlState.Selected)
UITabBarItem.appearance().finishedUnselectedImage([NSForegroundColorAttributeName: UIColor.whiteColor()], forState: UIControlState.Normal)
The code above is in my delegate.
Now I have put this code:
import UIKit
class UITabBarViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var testImage = UIImage(named: "22274")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
testImageView.tintColor = UIColor.redColor()
testImageView.image = testImage
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Into my tab bar view controller cocco touch file. I don't know why I'm getting an error still