上次我的貼文介紹了接api code,api接到了資料後,資料的解包格式也已經完成了,接下來就是如何使用
for i in 0...2{
cell.StartTime.text = "\(downloadData?.records.location[0].weatherElement[0].time[i].startTime ?? "")"
cell.EndTime.text = "\(downloadData?.records.location[0].weatherElement[0].time[i].endTime ?? "")"
cell.highTemperature.text = "\(downloadData?.records.location[0].weatherElement[4].time[i].parameter.parameterName ?? "")"+"度"
cell.lowTemperature.text = "\(downloadData?.records.location[0].weatherElement[2].time[i].parameter.parameterName ?? "")"+"度"
cell.ComfortDegree.text = "\(downloadData?.records.location[0].weatherElement[3].time[1].parameter.parameterName ?? "")"
cell.probabilityOfRain.text = "\(downloadData?.records.location[0].weatherElement[1].time[2].parameter.parameterName ?? "")"+"%"
cell.RainDescription.text = "\(downloadData?.records.location[0].weatherElement[0].time[0].parameter.parameterName ?? "")"
}