Created
June 13, 2016 09:43
-
-
Save nafferro/9b6b0264449362954e23c0398ca8bf7e to your computer and use it in GitHub Desktop.
How to change UIImage color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let origImage = UIImage(named: "imageName"); | |
| let tintedImage = origImage?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate) | |
| btn.setImage(tintedImage, forState: .Normal) | |
| btn.tintColor = UIColor.redColor() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment