URI (RFC 3986) for Swift 2.2.
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"
- Install
uri_parser
$ git clone https://github.com/Zewo/uri_parser.git
$ cd uri_parser
$ make
$ dpkg -i uri_parser.deb
- Add
URI
to yourPackage.swift
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/Zewo/URI.git", majorVersion: 0, minor: 1)
]
)
Join us on Slack.
URI is released under the MIT license. See LICENSE for details.