I am trying to use the Lyft API with iOS 11 and Swift 4, and am receiving an error on the second line, which is
Overlapping accesses to 'urlComponents', but modification requires exclusive access; consider copying to a local variable.
I am unsure what this means, and how I can get around it. Any help is appreciated, thanks!
let queryItems = parameters
.sorted { $0.0 < $1.0 }
.flatMap { components(forKey: $0, value: $1) }
var urlComponents = URLComponents(url: mutableURLRequest.url!, resolvingAgainstBaseURL: false)
urlComponents?.queryItems = (urlComponents?.queryItems ?? []) + queryItems //error here