calling asynchronous method inside for-loop [duplicate]
This question already has answers here : What's the best way to iterate over results from an APi, and know when it's finished? (1 answer) Swift Closures in for loop (1 answer) How do you run code after an async call finishes and the code is outside of the asyn function in swift3 (1 answer) Closed last year . Trying to make my for loop behave synchronously when I am making an asynchronous call in each iteration of the loop. I have a feeling I will need to use Grand Central Dispatch in some way but not sure. func test(strings: [String], completion: @escaping ((_ value: [String]) -> Void)) { var