2016-01-31 127 views
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) 
    } 
} 

回答