I am using SVGKit library to render svg into image view. Svg is rendering perfectly but the issue is I am unable to fill the SVG colour. I found few examples in Objective C those are not helpful for me. Here I am using Swift5. Please find the attached Controller code. Thanks in advance.
Code:
let namSvgImgVar: SVGKImage = SVGKImage(named: "camera")
let namImjVar: UIImage = namSvgImgVar.uiImage
imageView.image = namImjVar
I have created an extension for the same:
If your
SVGimage has only one layer to color usefillColor, orfillOutterLayerColorif there are multiple, you can modify it based on your need. This is how I use it: