Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift set uiimage color

extension UIImageView {
  func setImageColor(color: UIColor) {
    let templateImage = self.image?.withRenderingMode(.alwaysTemplate)
    self.image = templateImage
    self.tintColor = color
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #set #uiimage #color
ADD COMMENT
Topic
Name
3+6 =