Skip to content
Highly customizable replacement for deprecated Google Places Picker Controller.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
PlacePicker-iOS Working on Carthage support Jul 8, 2019
PlacePicker-iOSTests Working on Carthage support Jul 8, 2019
PlacesPicker.xcodeproj Deployment Target change Jul 8, 2019
PlacesPicker Added Initial coordinate and initial zoom Jul 9, 2019
PlacesPickerTests Initial Commit Jul 3, 2019
images Image Url Fix Jul 7, 2019
.gitignore Gitignore added Jul 4, 2019
Cartfile Gitignore added Jul 4, 2019
Cartfile.resolved
LICENSE Merge branch 'master' of github.com:piotrbernad/GooglePlacesPicker Jul 15, 2019
PlacesPicker.podspec Merge branch 'master' of github.com:piotrbernad/GooglePlacesPicker Jul 15, 2019
README.md Merge branch 'master' of github.com:piotrbernad/GooglePlacesPicker Jul 15, 2019

README.md

Google Places Picker

Highly customizable Place Picker which is based on Google Places API and Google Geocode services.

Picker allows user to select the location directly on the map or use search with autocompletion. As a result it provides GMSPlace object.

Installation via Carthage

Add following line to your Cartfile: github "piotrbernad/GooglePlacesPicker"

Import module using: import PlacePicker

Installation via Cocoapods

Add following line to your Cartfile: pod 'PlacesPicker'

Import module using: import PlacesPicker

Usage

To use Picker you need to provide Google Places API Key and Google Maps key to do so, you should call:

PlacePicker.configure(googleMapsAPIKey: "YOUR_KEY", placesAPIKey: "YOUR_PLACES_KEY")

Whenever you want to show controller call:

let controller = PlacePicker.placePickerController()
controller.delegate = self
let navigationController = UINavigationController(rootViewController: controller)
self.show(navigationController, sender: nil)

All events are delivered using PlacesPickerDelegate.

Optionally you can pass PlacePickerConfig which allows you to customize the look and behaviour of the picker.

Customization

You can easily customize the look of map and the list itself. All you need to do is to implement your own class of Renderer protocols.

To customize the look of the list implement and pass renderer object during config initalization:

public protocol PlacesListRenderer {
    func registerCells(tableView: UITableView)
    func cellForRowAt(indexPath: IndexPath, tableView: UITableView, object: PlacesListObjectType) -> UITableViewCell
}

To customize the look of the MapView implement:

public protocol PickerRenderer {
    func configureCancelButton(barButtonItem: UIBarButtonItem)
    func configureSearchButton(barButtonItem: UIBarButtonItem)
    func configureMapView(mapView: GMSMapView)
    func configureTableView(mapView: UITableView)
}

Contribution

Feel free to contribute.

TODO

  1. Setup cocoapods
  2. Write tests
You can’t perform that action at this time.