Latest 3.0.1
Homepage https://github.com/anjlab/SafeURL
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0, requires ARC
Authors

CI Status
Version
License
Platform

Usage

Construct urls from scratch

NSURL.build(scheme: "tel", path: "+7 (910) 670 14 00") // #> NSURL "tel:+7%20(910)%20670%2014%2000"

Use BaseURL

let baseURL = NSURL(string: "https://google.com")!
baseURL.build(query: ["q": "Safe URL"]) // #> NSURL "https://google.com?q=Safe%20URL"

Build paths. No unsafe string interpolations

let baseURL = NSURL(string: "https://example.com/api/v1/")!
let userId = 1
baseURL.build(["users", userId]) // #> NSURL "https://example.com/api/v1/users/1"

Requirements

  • iOS 8.0+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 7.3
  • Swift 2.2

Installation

SafeURL is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SafeURL"

Author

Yury Korolev, [email protected]

License

SafeURL is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SafeURL",
    "version": "3.0.1",
    "summary": "Swift safe NSURL Builder",
    "description": "Provide convinient methods on NSURL to craft urls in safe fashion.nn- Escapes path segementsn- Escapes query parametersn- Fast",
    "homepage": "https://github.com/anjlab/SafeURL",
    "license": "MIT",
    "authors": {
        "Yury Korolev": "[email protected]"
    },
    "source": {
        "git": "https://github.com/anjlab/SafeURL.git",
        "tag": "3.0.1"
    },
    "social_media_url": "https://twitter.com/anjlab",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This