Latest | 0.3 |
---|---|
Homepage | https://github.com/cogenta/CSURITemplate |
License | MIT |
Platforms | ios 5.0, osx 10.7, requires ARC |
Authors |
CSURITemplate is an Objective-C implementation of
RFC6570: URI Template up to Level 4 of
the spec.
Example usage:
NSError *error = nil;
CSURITemplate *template = [CSURITemplate URITemplateWithString:@"{?list*}"
error:&error];
NSDictionary *variables = @{@"list": @[@"red", @"green", @"blue"]};
NSString *uri = [template relativeStringWithVariables:variables error:&error];
assert([uri isEqualToString:@"?list=red&list=green&list=blue"]);
NSURL *baseURL = [NSURL URLWithString:@"http://www.example.com"];
NSURL *URL = [template URLWithVariables:variables relativeToURL:baseURL error:&error];
assert([uri isEqualToString:@"http://www.example.com?list=red&list=green&list=blue"]);
Installation
CocoaPods is the easiest way to use CSURITemplate.
platform :ios, '6.0'
pod 'CSURITemplate'
Latest podspec
{ "name": "CSURITemplate", "version": "0.3", "summary": "Implementation of the URI Template spec.", "homepage": "https://github.com/cogenta/CSURITemplate", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Will Harris": "[email protected]" }, "source": { "git": "https://github.com/cogenta/CSURITemplate.git", "tag": "0.3" }, "platforms": { "ios": "5.0", "osx": "10.7" }, "source_files": [ "CSURITemplate", "CSURITemplate/**/*.{h,m}" ], "public_header_files": "CSURITemplate/CSURITemplate.h", "requires_arc": true }
Sat, 27 Feb 2016 05:23:02 +0000