Skip to content

使用CAShapeLayer和贝塞尔曲线显示SVG,并提供点击单个元素的功能。

License

Notifications You must be signed in to change notification settings

Alexiusy/SVGlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVGlib

A repository for displaying SVG with CAShapeLayer.

screenshot

Feature

Parse basic element like path, line, rect, circle, ellipse, polygon and polyline.

  • Display a svg on the iPhone screen with CAShapeLayer.
  • Support select single layer.
  • Support svg original transform.

Usage

// filePath is the svg file path.
let svgView = SVGView().parse(filePath)
svgView.center = CGPoint(x: 200, y: 300)
svgView.transform = CGAffineTransform.init(scaleX: 0.2, y: 0.2)

self.view.addSubview(svgView);

Then, that's done.

TODO

  • Add gradient effect and filter effect support.

About

使用CAShapeLayer和贝塞尔曲线显示SVG,并提供点击单个元素的功能。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages