mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/ios-sdk.git
synced 2026-03-06 15:18:02 +08:00
12 lines
398 B
Swift
12 lines
398 B
Swift
import Foundation
|
|
|
|
extension URL {
|
|
public var queryParameters: [String: String]? {
|
|
guard
|
|
let components = URLComponents(url: self, resolvingAgainstBaseURL: true),
|
|
let queryItems = components.queryItems else { return nil }
|
|
return queryItems.reduce(into: [String: String]()) { (result, item) in
|
|
result[item.name] = item.value
|
|
}
|
|
}
|
|
}
|