我在 SOAP 服务中有一个查询,它返回一个 DataSource,DataSource 每行有两列,如何使用 Swift 2.3 将这些列带入 UIPickerView?
我正在使用此代码来传递数据源:
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
print(DataSource[row])
if component == 0 {
return DataSource[row][IdPessoa] as? String
} else {
return DataSource[row][Empresa] as? String
}
}