SVGUIView

一个 UIView,用于在你的界面中显示单个 SVG 图像。

用法

创建 SVGUIView

let data = Bundle.main.url(forResource: "example", withExtension: "svg")!
let svgView = SVGUIView(contentsOf: data)!
view.addSubView(svgView)

安装

SwiftPM

添加 SVGUIView 作为依赖项

let package = Package(
    // name, platforms, products, etc.
    dependencies: [
        // other dependencies
        .package(url: "https://github.com/nnabeyang/SVGUIView", from: "0.19.1"),
    ],
    targets: [
        .executableTarget(name: "<executable-target-name>", dependencies: [
            // other dependencies
                .product(name: "SVGUIView", package: "SVGUIView"),
        ]),
        // other targets
    ]
)

CocoaPods

将以下内容添加到你的 Podfile

pod 'SVGUIView'

许可证

SVGUIView 根据 MIT 许可证发布,请参阅 LICENSE。

作者

Noriaki Watanabe@nnabeyang