Swiftpack.co - Package - ephedra-software/URLBuilder

URLBuilder Build Status Version codecov

Simple abstraction for URLComponents for ease to use

CocoaPods

For URLBuilder, use the following entry in your Podfile:

pod 'URLBuilder', '~> 1.0'

Then run pod install.

SwiftPM (Accio)

For install URLBuilder with Accio (or SwiftPM from Xcode 11) add this line to Package.swift

.package(url: "https://github.com/ephedra-software/URLBuilder.git", .upToNextMajor(from: "1.0"))

Then run accio install or accio update.

In any file you'd like to use URLBuilder in, don't forget to import the framework with import URLBuilder. 😉

Usage

Using URLBuilder is really simple. You can access an API like this:

let url = URLBuilder
    .scheme(.https)
    .user(custom: "john.doe")
    .host(custom: "www.example.com")
    .port(custom: 123)
    .path(custom: "/forum/questions")
    .query(items: ("tag", "networking"), ("order", "order"))
    .fragment(custom: "top")
    .url

print(url ?? "nil") // https://john.doe@www.example.com:123/forum/questions?tag=networking&order=order#top

This is a very simple example. Don't do that 😄

License

URLBuilder is released under an MIT license. See LICENSE for more information.

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

1.0.3 - Aug 5, 2019

1.0.2 - Aug 5, 2019

1.0.0 - Aug 5, 2019