Latest 1.0.0
Homepage https://github.com/illyabusigin/UIBezierPathSerialization
License MIT
Platforms ios 6.0, requires ARC
Frameworks CoreGraphics
Authors

Version
License
Platform

by Illya Busigin

Purpose

UIBezierPathSerialization encodes and decodes between JSON and UIBezierPath objects, following the API conventions of Foundation’s NSJSONSerialization class. The output JSON implements a subset of the Path to JSON proposal that allows SVG Paths to be serialized as a normalized JSON object.

Installation

To install UIBezierPathSerialization, just drag the class files into your project. Alternatively, if you’re using CocoaPods just specify pod 'UIBezierPathSerialization' in your Podfile.

Usage

Encoding

#import "UIBezierPathSerialization.h"

UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 100, 100)];
NSError *error = nil;

NSData *data = [UIBezierPathSerialization dataWithBezierPath:bezierPath options:0 error:&error];

Decoding

#import "UIBezierPathSerialization.h"

NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"simple_path" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSError *error = nil;

UIBezierPath *bezierPath = [UIBezierPathSerialization bezierPathWithData:data options:0 error:&error];

Bugs & Feature Requests

There is no support offered with this component. If you would like a feature or find a bug, please submit a feature request through the GitHub issue tracker.

Pull-requests for bug-fixes and features are welcome!

License

UIBezierPathSerialization is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UIBezierPathSerialization",
    "version": "1.0.0",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Encode and decode between JSON and UIBezierPath objects",
    "authors": {
        "Illya Busigin": "http://illyabusigin.com/"
    },
    "source": {
        "git": "https://github.com/illyabusigin/UIBezierPathSerialization.git",
        "tag": "1.0.0"
    },
    "homepage": "https://github.com/illyabusigin/UIBezierPathSerialization",
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "UIBezierPathSerialization",
    "frameworks": "CoreGraphics",
    "requires_arc": true
}

Pin It on Pinterest

Share This