SNR
SNR

Reputation: 1249

iOS google places API - compile error - use of undeclared identifier GMSAutocompleteViewController

I have installed GoogleMaps SDK using CocoaPods.
For some screen I need to use Google Places API
Here is the code

GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init];
acController.delegate = self;
[self presentViewController:acController animated:YES completion:nil];

Which I have got from https://developers.google.com/places/ios-api/autocomplete
The error - use of undeclared identifier 'GMSAutocompleteViewController'

Upvotes: 1

Views: 1615

Answers (1)

AndrewR
AndrewR

Reputation: 10889

Have you added #import <GoogleMaps/GoogleMaps.h> to the file?

The other possibility is that you have an older version of the GoogleMaps pod (GMSAutocompleteViewController was added in version 1.11). To fix this, just run

pod update

in the project directory.

Upvotes: 3

Related Questions