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 results: [String] = []
    for string in strings {
        Service.shared.fetch(with: string, completion: { (result) in
            results.append(result)
        })
    }
    // this will run before asynchronous method in for-loop runs n times.
    completion(results)
}