Skip to content

Sample for Autocompletion of Address using MapKit and Google Places API for iOS < 9.3

Notifications You must be signed in to change notification settings

jpunz/AddressAutoCompletion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Swift-Sample for Autocompletion of Address using MapKit and Google Places API for iOS-Versions lower than 9.3. In this Sample I'm using a UISearchBar for input and UITableView for presenting the results of AddressAutoCompletion.

The reason why i created this sample, is that you only get 1000 or 150000 free requests per day from Google Places API (source: https://developers.google.com/places/web-service/usage). The autocompletion based on MapKit-Framework is only working for iOS-Devices with an minimum iOS-Version of 9.3.

You need the following in your podfile:

pod 'HNKGooglePlacesAutocomplete', '~> 1.2'

and this in your AppDelegate:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        if #available(iOS 9.3, *){}
        else
        {
            HNKGooglePlacesAutocompleteQuery.setupSharedQueryWithAPIKey("YOUR GOOGLE PLACES API WEB SERVICE KEY")
        }
        
        return true
}

Help for API-Key-Creation: https://developers.google.com/places/android-api/signup

IMPORTANT: Use an API-Key for "Google Places API Web Service". A key for "Google Places API for iOS" won't work!

About

Sample for Autocompletion of Address using MapKit and Google Places API for iOS < 9.3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages