1
をキャンセルするかを選択させないこと。私は間違いなく私のクラスでGMSPlacePickerViewControllerDelegateを実装しました。プレイスピッカーが開き、場所を表示でき、それらをタップすると検索できます。私はこの画面から出ることはできません、私はキャンセルすることはできません、私は実際に何かを選択したり、場所を返すことはできません。これは、物理デバイスとシミュレータ上で同じです。なぜそれは動作しません、そして、私はそれを動作させることができますか?GoogleプレイスAPIは、私は、Googleのウェブサイト上の場所APIのチュートリアルに従っている、と私は二重のiOS用の場所APIが有効になっていることを確認し、自分のAPIキーは私AppDelegateであることをしている私は
@IBAction func selectLocationPressed(_ sender: Any) {
let config = GMSPlacePickerConfig(viewport: nil)
let placePicker = GMSPlacePickerViewController(config: config)
present(placePicker, animated: true, completion: nil)
}
// To receive the results from the place picker 'self' will need to conform to
// GMSPlacePickerViewControllerDelegate and implement this code.
func placePicker(_ viewController: GMSPlacePickerViewController,
didPick place: GMSPlace) {
// Dismiss the place picker, as it cannot dismiss itself.
viewController.dismiss(animated: true, completion: nil)
print("Place name \(place.name)")
print("Place address \(place.formattedAddress)")
print("Place attributions \(place.attributions)")
}
func placePickerDidCancel(_ viewController:
GMSPlacePickerViewController) {
// Dismiss the place picker, as it cannot dismiss itself.
viewController.dismiss(animated: true, completion: nil)
print("No place selected")
}
を設定し、私はGitHubの上でいくつかのプロジェクトを経て、私は逃したと思いますどのようなワークアウトした後、これを自分自身を追加することを約ありました!ありがとう – markeh21