How can I color a UIImage in Swift?

后端 未结 20 2261
执念已碎
执念已碎 2020-11-29 18:27

I have an image called arrowWhite. I want to colour this image to black.

func attachDropDownArrow() -> NSMutableAttributedString {
    let im         


        
20条回答
  •  情话喂你
    2020-11-29 19:02

    Post iOS 13 you can use it something like this

    arrowWhiteImage.withTintColor(.black, renderingMode: .alwaysTemplate)
    

提交回复
热议问题