Swift 在Google Place Picker之后更改视图控制器
是否有人知道在Google place Picker中选择一个位置后如何转到其他视图控制器,而不是调用位置选择器的位置 根据google place picker的说法 希望这有帮助您可以使用“mapView(\mapView:GMSMapView,didTapInfoWindowOf marker:GMSMarker)”委托函数,点击google marker时将调用此函数事件Swift 在Google Place Picker之后更改视图控制器,swift,xcode,google-maps-api-3,gmsplacepicker,Swift,Xcode,Google Maps Api 3,Gmsplacepicker,是否有人知道在Google place Picker中选择一个位置后如何转到其他视图控制器,而不是调用位置选择器的位置 根据google place picker的说法 希望这有帮助您可以使用“mapView(\mapView:GMSMapView,didTapInfoWindowOf marker:GMSMarker)”委托函数,点击google marker时将调用此函数事件 @IBAction func pickPlace(_ sender: UIButton) { let confi
@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)")
})
}