Использование TRVSURLSessionOperation поможет вам, вот как это сделать:
let queue = OperationQueue()
let session = URLSession(configuration: URLSessionConfiguration.default)
let firstOperation = TRVSURLSessionOperation(session: session, request: URLRequest(url: URL(string: "first url")!)) { (data, response, error) in
// Your completion logic
}
let secondOperation = TRVSURLSessionOperation(session: session, request: URLRequest(url: URL(string: "second url")!)) { (data, response, error) in
// Your completion logic
}
secondOperation?.addDependency(firstOperation!)
queue.addOperations([firstOperation!, secondOperation!], waitUntilFinished: false)