我正在使用Swift在iOS上进行下拉刷新。我有一个包含城市名称的数组,cityNames=["Chicago","NewYorkCity"]我实现了下拉刷新以从互联网上获取温度数据。因此,每次我触发下拉刷新时,它都会连接到互联网并获取cityNames数组中每个城市的温度。这是下拉刷新的代码varweatherDetail=[Weather]()//PulltorefreshfuncrefreshData(){varcityNames=[String]()for(index,_)inweatherDetail.enumerate(){letinfo=weatherDetail[ind