X-Git-Url: https://git.mdrn.pl/wl-app.git/blobdiff_plain/53b27422d140022594fc241cca91c3183be57bca..48b2fe9f7c2dc3d9aeaaa6dbfb27c7da4f3235ff:/iOS/Pods/OAuthSwift/Sources/URL%20OAuthSwift.swift/wl-app.git/blobdiff_plain/53b27422d140022594fc241cca91c3183be57bca..48b2fe9f7c2dc3d9aeaaa6dbfb27c7da4f3235ff:/iOS/Pods/OAuthSwift/Sources/URL+OAuthSwift.swift diff --git a/iOS/Pods/OAuthSwift/Sources/URL+OAuthSwift.swift b/iOS/Pods/OAuthSwift/Sources/URL+OAuthSwift.swift new file mode 100755 index 0000000..e963754 --- /dev/null +++ b/iOS/Pods/OAuthSwift/Sources/URL+OAuthSwift.swift @@ -0,0 +1,29 @@ +// +// URL+OAuthSwift.swift +// OAuthSwift +// +// Created by Dongri Jin on 6/21/14. +// Copyright (c) 2014 Dongri Jin. All rights reserved. +// + +import Foundation + +extension URL { + + func urlByAppending(queryString: String) -> URL { + if queryString.utf16.isEmpty { + return self + } + + var absoluteURLString = absoluteString + + if absoluteURLString.hasSuffix("?") { + absoluteURLString.dropLast() + } + + let string = absoluteURLString + (absoluteURLString.range(of: "?") != nil ? "&" : "?") + queryString + + return URL(string: string)! + } + +}