EurekaCommunity / GooglePlacesRow

This repository aims to create a row for Eureka with autocomplete from Google Places
MIT License
60 stars 12 forks source link

Getting value out of a row #26

Closed antonijap closed 6 years ago

antonijap commented 6 years ago

I might be missing something super clear but when I use row.value I get this:

prediction(GMSAutocompletePrediction 0x60000024f3f0: "City, Country", id: ChIJkQYhlscLkkYRY_fiO4S9Ts0, types: (
    locality,
    political,
    geocode
))

I see in source code GooglePlace is an enum but I have zero clues how to extract city and country out of this.

mats-claassen commented 6 years ago

GMSAutocompletePrediction is defined in GooglePlaces. You can look at their documentation but here are a few properties of that class:

attributedFullText is the whole prediction String. attributedPrimaryText is the first part and attributedSecondaryText is the second part.

Example:

Full: Sydney Opera House, Sydney, New South Wales, Australia First part: Sydney Opera House Second part: Sydney, New South Wales, Australia