填充数组,然后调用函数

完成获取数据后,我一个接一个地接收数据项。我想将此项目附加到数组中,然后调用数据,该怎么办?我如何告诉函数等待所有数据追加到数组中-数据数量不同。

self?.dataModel.fetchExportCSV(id: id, completion: { [weak self] in
    switch $0 {
      case .success(let data):
          var arryData: [exportVO] = []
          arryData.append(data)

          //this is the fucntion that should be called after all the data are append to the array
          createCSV(data: arryData)

您的帮助将不胜感激

评论