根据 Place Autocomplete 文档,预测数组的对象没有位置信息。那么我应该如何获取经度和纬度的详细信息。下面是我的代码 -
extension ViewController: GMSAutocompleteFetcherDelegate {
func didAutocomplete(with predictions: [GMSAutocompletePrediction]) {
tableData.removeAll()
for prediction in predictions{
tableData.append(prediction.attributedFullText.string)
}
locationTable.reloadData()
}
func didFailAutocompleteWithError(_ error: Error) {
print(error.localizedDescription)
}
Run Code Online (Sandbox Code Playgroud)