Using the 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)
        }
}

I used this method to search for an address on a google map. But an error was found Use of unresolved identifier 'GMSPlacesClient'. How can i solve this?

+4
source share
2 answers

Use of unresolved identifier 'GMSPlacesClient'The error probably occurs when your new class has a different target from another. This thread indicates that it may have a target audience, while the other may not. For this case, you must include all of your classes in the test target, or none of them.

" ". . , , . (), , .

SO. , !

+3

cocoapod, pod 'GooglePlaces'. GooglePlaces.

+8

Source: https://habr.com/ru/post/1650263/


All Articles