How to render all kinds of SVG files on iPhone?

后端 未结 1 1640
盖世英雄少女心
盖世英雄少女心 2020-12-22 04:34

For rendering svg file on iPhone I have downloaded a project from GitHub SVGQuartzRenderer but it shows the following errors:

  1. UIKit/UIKit.h No such file o
相关标签:
1条回答
  • 2020-12-22 04:37

    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

    0 讨论(0)
提交回复
热议问题