ios - Google places - GMSAutocompleteViewController didAutocompleteWith full text -
this delegate function in viewcontroller :
func viewcontroller(_ viewcontroller: gmsautocompleteviewcontroller, didautocompletewith place: gmsplace) { print("place name: \(place.name)") print("place address: \(place.formattedaddress)") dismiss(animated: true, completion: nil) }
i searched "grav skole" , selected first option here :
following logs :
place name: grav skole
place address: "hosleveien 24, 1358 jar, norway"
on android, result displayed "grav skole, hosleveien, jar, norway", desired text , not match ios.
missing ?
it sounds want access text of predictions displayed in list gmsautocompleteviewcontroller
. can implementing viewcontroller:didselectprediction
method of gmsautocompleteviewcontrollerdelegate
, called when item selected.
func viewcontroller(_ viewcontroller: gmsautocompleteviewcontroller, didselectprediction prediction: gmsautocompleteprediction) -> bool { print("primary: \(prediction.attributedprimarytext)") print("secondary: \(prediction.attributedsecondarytext)") return false; }
Comments
Post a Comment