'GMS Place missing viewport member
I updated my CocoaPods and now my previously working code is not compiling. The error says "Value of type 'GMSPlace' has no member 'viewport'."
func viewController(_ viewController: GMSAutocompleteViewController, didAutocompleteWith place: GMSPlace) {
dismiss(animated: true, completion: {
guard let viewport = place.viewport else { return }
self.mapView.animate(with: GMSCameraUpdate.fit(viewport))
})
}
I am importing GoogleMaps and GooglePlaces, but the viewport member is mysteriously missing. I tried switching to using place.viewportInfo, but then I get an error "Cannot convert value of type 'GMSPlaceViewportInfo' to expected argument type 'GMSCoordinateBounds'."
How can I get the viewport from a GMSPlace, and then use it to create a GMSCameraUpdate?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
