1
我正在尝试使用来自Google Maps SDK for IOS的一些示例代码。下面的代码给我一个错误消息:类型ViewController
不符合协议GMSAutocompleteResultsViewControllerDelegate
。见下面的代码。有谁知道什么是不符合。符合协议的GMSAutocompleteResultsViewControllerDelegate Swift
extension ViewController: GMSAutocompleteResultsViewControllerDelegate {
func resultsController(resultsController: GMSAutocompleteResultsViewController!,
didAutocompleteWithPlace place: GMSPlace!) {
searchController?.active = false
// Do something with the selected place.
print("Place name: ", place.name)
print("Place address: ", place.formattedAddress)
print("Place attributions: ", place.attributions)
}
func resultsController(resultsController: GMSAutocompleteResultsViewController!,
didAutocompleteWithError error: NSError!){
// TODO: handle the error.
print("Error: ", error.description)
}
}