Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift set uiimage color

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

change image tint color swiftui

Image("ImageName")
   .renderingMode(.template)
   .foregroundColor(.white)
Comment

PREVIOUS NEXT
Code Example
Swift :: fizzbuzz in swift 
Swift :: array length swift 
Swift :: round down swift 
Swift :: swift wait 5 seconds 
Swift :: swift get max of two numbers 
Swift :: swiftui vstack alignment 
Swift :: swiftui textfield multiline 
Swift :: Swift Properties 
Swift :: add top corner radius swift 
Swift :: swift alamofire x-www-form-urlencoded 
Swift :: how to bold text swiftui 
Swift :: swift replace all characters except numbers 
Swift :: swift go to root view controller 
Swift :: swift reload tableviewcell at index 
Swift :: go to view controller programmatically swift 
Swift :: swift 5 get current date 
Swift :: enviroment dissmiss swiftui 
Swift :: swft image 
Swift :: swift multiline string 
Swift :: make optional protocol swift 
Swift :: swift uilabel dynamic height based on text length 
Swift :: how to include a library in swift 
Swift :: toggle button swift 
Swift :: swift 
Swift :: Swift Remove an Element from a Set 
Swift :: Swift Initializer 
Swift :: dequeueReusableCellWithIdentifier returns nil 
Swift :: Swift Function overloading with Argument Label 
Swift :: function parameters swift 
Swift :: string swift 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =