Comments (1)
That's because you're assuming that pathFromSVGFileNamed
is a class factory method, such as:
UIColor *color = [UIColor colorWithRed:0.5 green:0.0 blue:0.5 alpha:1.0];
Factory methods do get mapped as convenience initializers in Swift:
let color = UIColor(red: 0.5, green: 0.0, blue: 0.5, alpha: 1.0)
But pathFromSVGFileNamed
is not a factory method, it's a regular class method. As such, you use it like this:
let myPath = PocketSVG.pathFromSVGFileNamed("BezierCurve1").takeUnretainedValue()
See the Initialization section of the Interacting with Objective-C APIs doc.
I've updated PocketSVG's documentation accordingly.
from pocketsvg.
Related Issues (20)
- SPM support HOT 2
- Is it possible to convert UIBezierPath to SVG ? HOT 1
- Support Image Tag
- Scaling the SVGImageView the svg content (sometimes) disappears HOT 4
- Can't parse SVG tags such as <defs> and <g> HOT 2
- Carthage installation error HOT 2
- Can we convert NSImage to SVG in Swift OSX? HOT 1
- Error on basic execution of example code with simple svg file HOT 3
- How to convert UIBezierpath to SVG? HOT 8
- Fails to load SVGColors.plist when using SPM HOT 2
- convert UIBezierpath to SVG HOT 8
- The path I've drawn is truncated HOT 1
- Carthage: Dependency "PocketSVG" has no shared framework schemes HOT 1
- How to Convert SVGPath String to SVG Image And Set in ImageView. HOT 2
- not working svg path string with style HOT 1
- No spaces between Arc's large-arc-flag, sweep-flag and x is not handled HOT 2
- How to export SVG file HOT 1
- Clear Cache HOT 1
- *** Assertion failure in svgParser::svgParser(NSString *__strong)(), SVGEngine.mm:95 HOT 1
- The SVGStringFromCGPaths function causes the program to crash. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketsvg.