Skip to content

Commit

Permalink
Added 2.0 announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
mchoe committed Jul 5, 2017
1 parent c8d22ff commit 2fd40cb
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@

![SwiftSVG Logo](/images/SwiftSVG-Logo.png)

```
⚡⚡⚡ ANNOUNCEMENT ⚡⚡⚡
A new version of SwiftSVG is coming soon! 2.0 will bring wider support for more elements
types and attributes, a brand new architecture for greater extensibility, and a faster,
more stable parser.
If you want to try it out, check out the feature/2.0.0 branch or install through Cocoapods:
pod 'SwiftSVG', :git => '[email protected]:mchoe/SwiftSVG.git', :branch => 'feature/2.0.0'
Stay tuned for more information and thanks for your support!
```

SwiftSVG
========

Expand Down Expand Up @@ -48,7 +61,7 @@ Usage

SwiftSVG provides multiple interfaces to parse single path strings and SVG files using NSXMLParser.

####String+SVG####
### String+SVG

The simplest way is to parse raw path data using `parseSVGPath()`

Expand All @@ -70,12 +83,12 @@ Or, you can use the String extension `pathFromSVGString()`:
let parsedPath: UIBezierPath = examplePathData.pathFromSVGString()
```

#####Output:#####
#### Output:
![This is not a triangle](/images/triangle.png)

***

####UIBezierPath+SVG####
### UIBezierPath+SVG

SwiftSVG also provides a convenience initializer for UIBezierPath that allows you to either create a `UIBezierPath` from a path string or from an SVG file:

Expand All @@ -93,12 +106,12 @@ let pathFromSVGFile = UIBezierPath.pathWithSVGURL(svgURL)
shapelayer.path = pathFromSVGFile
```

#####Output:#####
#### Output:
![Put it here!](/images/fistBump.png)

***

####CAShapeLayer+SVG####
### CAShapeLayer+SVG

You can create a `CAShapeLayer` from a path string or SVG file:

Expand All @@ -112,7 +125,7 @@ let svgURL = NSBundle.mainBundle().URLForResource("pizza", withExtension: "svg")
let svgShapeLayerFromFile = CAShapeLayer(SVGURL: svgURL)
```

#####Output:#####
#### Output:
![This is not delicious pizza](/images/pizza.png)

Fill colors are read automatically if provided as an attribute on the path element. The fill attribute must be supplied as a hex value:
Expand All @@ -122,7 +135,7 @@ Fill colors are read automatically if provided as an attribute on the path eleme

***

####UIView+SVG####
### UIView+SVG

A UIView convenince initializer is provided as well. Same thing goes as with CAShapeLayer, you can supply a path string or an SVG file:

Expand All @@ -136,12 +149,12 @@ let svgURL = NSBundle.mainBundle().URLForResource("sockPuppet", withExtension: "
let svgViewFromFile = UIView(SVGURL: svgURL)
```

#####Output:#####
#### Output:
![This is not a sock puppet](/images/sockPuppet.png)

***

####SVGView####
### SVGView

Finally, SwiftSVG provides a `UIView` subclass that is `IBInspectable` and `IBDesignable`. Simply add a view to your storyboard and use the SVGView subclass as you class name. Then put the name of your SVG file in your bundle in the `IBInspectable` property "SVGName"

Expand Down

0 comments on commit 2fd40cb

Please sign in to comment.