我正在 swift Project 中使用 SVGKit。我按照以下( https://github.com/SVGKit/SVGKit)正确地将 SVGKit 框架和 3rd 方资源文件夹导入到我的项目中。
我在项目中创建了一个包含 .svg 图像集的文件夹,并且我正在使用以下代码将图像加载到 testIcon(ImageView) 中。
let lockImage: SVGKImage = SVGKImage(named: "LockIcon.svg")
let lockImageLocal: UIImage = lockImage.uiImage
testIcon.image = lockImageLocal
但我收到以下错误,
** +[SVGKImage imageWithSource:]、/Users/fss/Downloads/SVGKit-2.x/Source/SVGKImage.m:229 中的断言失败
*** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无效参数不满足:newSource!= nil”
请让我知道如何将.svg图像路径(在我的项目中)提到 SVGKImage 图像类或如何解决此问题。