URI (RFC 3986) for Swift 2.
- No
Foundation
dependency (Linux ready)
let uri = URI(string: "abc://username:[email protected]: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"
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 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
To use URI in a command line application:
- Install the Swift Command Line Application Xcode template
- Follow Cocoa Pods or Carthage instructions.
Join us on Slack.
URI is released under the MIT license. See LICENSE for details.