With the code below, I want to print query items into textview, but only the last query appears. When I print it on the console, all are visible.
let url = URL(string: inputURL.string)!
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
if let components = components {
if let queryItems = components.queryItems {
for queryItem in queryItems {
outputURL.string = "\(queryItem.name) = \(queryItem.value ?? "")"
print("\(queryItem.name) = \(queryItem.value ?? "")")
}
}
}