16 lines
322 B
Swift
16 lines
322 B
Swift
import Foundation
|
|
|
|
extension URL {
|
|
func appending(queryItems: [URLQueryItem]) -> Self {
|
|
var components = URLComponents(url: self, resolvingAgainstBaseURL: true)
|
|
|
|
components?.queryItems = queryItems
|
|
|
|
return components?.url ?? self
|
|
}
|
|
|
|
func appending(path: String) -> Self {
|
|
appendingPathComponent(path)
|
|
}
|
|
}
|