If you just need to change the color of the icons, you can probably solve this without svg. Just use the colors of the shades.
Create a template image:
let templateImage = UIImage(named: "bla_bla")?.withRenderingMode(.alwaysTemplate)
Then add it to the button or image view and set tintColor :
button.setImage(templateImage, for: .normal) button.setImage(templateImage, for: .highlighted) button.tintColor = UIColor.blue
This solution only works for monochrome icons!
Also, if you want .svg, you can use WKWebView , it is very fast and will not cause overhead if you have a limited number of icons.
kelin source share