![](/img/trans.png)
[英]'Use of unresolved identifier FIRStorage' (Swift - Xcode 7.3.1)
[英]Use of unresolved identifier 'GMSPlacesClient' in xcode 7.3.1
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'
錯誤。 我怎么能解決這個問題?
如果使用cocoapod,則需要添加pod'GooglePlaces'。 並導入GooglePlaces。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.