Set UIImageView tintColor with multiple colors

Viewed 294

,

I have this png image. How can I change this blue color (only) to a different color in swift. This because I might need to change to many different colors. Even better if its possible to change the black color to white.

2 Answers

you can try like this:

    self.img.image = self.img.image?.withRenderingMode(.alwaysTemplate)
    self.img.tintColor = UIColor.black
let tableImage: UIImageView = {
    let image = UIImageView()
    image.image = image.withRenderingMode(.alwaysTemplate)
    image.tintColor = .white
    return image
}()

try this, this will change your image tintColor. I don't think you can set mutiple colors in image

Related