Skip to content

Latest commit

 

History

History
99 lines (66 loc) · 2.93 KB

File metadata and controls

99 lines (66 loc) · 2.93 KB

URI

Swift 2.1 Platforms OS X | iOS Cocoapods Compatible Carthage Compatible License MIT Slack Status

URI (RFC 3986) for Swift 2.

Features

  • No Foundation dependency (Linux ready)

Usage

let uri = URI(string: "abc://username:password@example.com:123/path/data?key=value#fragid1")

uri.scheme // "abc"
uri.userInfo?.username // "username"
uri.userInfo?.password // "password"
uri.host // "example.com"
uri.port // 123
uri.path // "/path/data"
uri.query["key"] // "value"
uri.fragment // "fragid1"

let uri = URI(path: "/api/v1/tasks", query: ["done": "true"])

uri.path // "/api/v1/tasks"
uri.query["done"] // "true"

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build URI.

To integrate URI into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/Zewo/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

pod 'URI', '0.1'

Don't forget source 'https://github.com/Zewo/Specs.git'. This is very important. It should always come before the official CocoaPods repo.

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate URI into your Xcode project using Carthage, specify it in your Cartfile:

github "Zewo/URI" == 0.1

Command Line Application

To use URI in a command line application:

Community

Slack

Join us on Slack.

License

URI is released under the MIT license. See LICENSE for details.