You have a struct "Worker" with method that fetches one worker by id. Write method that will fetch multiple workers by array of ids.
Anónimo
struct Worker { func fetch(objectWithId id: String, completion: @escaping (Data) -> Void) { ... } } extension Worker { func fetch(objectsWithIds ids: [String], completion: @escaping ([Data]) -> Void) { var dataArr = [Data]() for i in ids.count-1 { fetch(objectWithId: ids[i]) { dataArr.append(Data) } } completion(dataArr) } }