Jack Li Jack Li - 3 months ago 19
iOS Question

Change Color of Image View Icons Swift

I am programming an app in XCode 7.3 for iOS 9.3, and have a menu with different icons for each cell. I am trying to make the icons white, as they are default black, but

cell!.imageView?.tintColor()
seems to have no effect. Is there another method I could use?

Answer

Lets try this:

theImageView.image!.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
theImageView.tintColor = UIColor.redColor()
Comments