Move extension out of utils

This commit is contained in:
Yishi Lin 2018-09-23 20:02:07 +08:00
parent 421b5aed1d
commit 429ac1c915
4 changed files with 121 additions and 93 deletions

View file

@ -0,0 +1,18 @@
//
// StringExtension.swift
// passKit
//
// Created by Yishi Lin on 2018/9/23.
// Copyright © 2018 Bob Sun. All rights reserved.
//
import Foundation
public extension String {
func stringByAddingPercentEncodingForRFC3986() -> String? {
let unreserved = "-._~/?"
var allowed = CharacterSet.alphanumerics
allowed.insert(charactersIn: unreserved)
return addingPercentEncoding(withAllowedCharacters: allowed)
}
}