How to render all kinds of SVG files on iPhone?
For rendering svg file on iPhone I have downloaded a pro开发者_如何学Cject from GitHub SVGQuartzRenderer but it shows the following errors:
UIKit/UIKit.h No such file or directory
(I am not able to add it using add existing frameworks)Libxml/tree.h:No such file or directory
Expected specifier-qualifier list before xmlParserCtxtPtr
Does anyone know how I can make this project work?
I have also found another framework: SVGKit. It works well for some SVG files but not for all.
Is it possible to render any SVG file in iPhone without using UIWebView
and are there any tutorials or sample code?
Starting Xcode 12, you can add the .svg file in your Assets Catalog and do this:
let image = UIImage(named: "SomeSVGImage")
ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes
精彩评论