func searchBar(searchBar: UISearchBar,
textDidChange searchText: String){
let placesClient = GMSPlacesClient()
placesClient.autocompleteQuery(searchText, bounds: nil, filter: nil) { (results, error:NSError?) -> Void in
self.resultsArray.removeAll()
if results == nil {
return
}
for result in results!{
if let result = result as? GMSAutocompletePrediction{
self.resultsArray.append(result.attributedFullText.string)
}
}
self.searchResultController.reloadDataWithArray(self.resultsArray)
}
}
我用這種方法在谷歌地圖中搜索地址。但發現Use of unresolved identifier 'GMSPlacesClient'
錯誤。我怎麼解決這個問題?在xcode中使用未解析的標識符'GMSPlacesClient'7.3.1
你在此視圖控制器中導入谷歌地圖嗎? –
import GoogleMaps是的,我輸入這個。 –
基本上它通過cocoapds安裝Almofire之前工作正常。但是當我在豆莢中添加almofire時,我更新了豆莢這個錯誤occor。 –