Does anyone know how to go to a different view controller after selecting a place in Google Place Picker other than the one that called the place picker?
Asked
Active
Viewed 606 times
0
-
1You can use ''mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker)" delegate function, This function event will call while tap google marker – Manikandan D Mar 22 '17 at 04:05
1 Answers
0
according to google place picker documentation
@IBAction func pickPlace(_ sender: UIButton) {
let config = GMSPlacePickerConfig(viewport: nil)
let placePicker = GMSPlacePicker(config: config)
placePicker.pickPlace(callback: { (place, error) -> Void in
if let error = error {
print("Pick Place error: \(error.localizedDescription)")
return
}
if let place = place {
DispatchQueue.main.async {
//code to push or present a viewController
}
} else {
print("No place selected")
return
}
print("Place name \(place.name)")
print("Place address \(place.formattedAddress)")
print("Place attributions \(place.attributions)")
})
}
Hope this helps

Sree
- 530
- 1
- 8
- 20