1

I'm using this code which works well on iPhone but I need to color a WKImage in WatchKit, how can I do this? I tried using the same code for an Extension on WKInterfaceImage but the image property is get only.

extension UIImageView {
    func setImageColor(color: UIColor) {
        let templateImage = self.image?.withRenderingMode(UIImage.RenderingMode.alwaysTemplate)
        self.image = templateImage
        self.tintColor = color
    }
}

How can I color a UIImage in Swift?

GarySabo
  • 5,806
  • 5
  • 49
  • 124

0 Answers0