Giter Site home page Giter Site logo

hiplaces's Introduction

HIPlaces

[![CI Status](http://img.shields.io/travis/Hozefa Indorewala/HIPlaces.svg?style=flat)](https://travis-ci.org/Hozefa Indorewala/HIPlaces) Version License Platform

An Objective - C wrapper for the Google Places API. The library currently includes

  1. Place Autocomplete
  2. Place Details

Requirements

You will need a valid Google API key which you can obtain from the Google Developers Console. Once you have a key, replace the "YOUR_KEY_HERE" string in HIPlaceAutocompleteViewController.m & HIPlaceDetailsTableViewController.m with your Google API key.

Usage

Example

To run the HIPlacesExample project, clone the repo, and run pod install from the HIPlaces directory first. Don't forget to replace the "YOUR_KEY_HERE" string in HIPlaceAutocompleteViewController.m & HIPlaceDetailsTableViewController.m with your Google API key. If you don't have one then obtain one from the Google Developers Console.

HIPlacesExample PlaceAutocomplete HIPlacesExample PlaceDetails

API

1. Import HIPlaces

#import <HIPlaces/HIPlaces.h>

2. Set up HIPlacesManager

HIPlacesManager *_placesManager = [[HIPlacesManager alloc] init];
_placesManager.delegate = self;

3. Create and perform PlaceAutocomplete or PlaceDetails requests

HIPlaceAutocompleteRequest *placeAutocompleteRequest = [[HIPlaceAutocompleteRequest alloc] init];
placeAutocompleteRequest.key = @"YOUR_KEY_HERE";
placeAutocompleteRequest.input = @"Paris";
[_placesManager searchForPlaceAutocompleteResultsWithRequest:placeAutocompleteRequest];

HIPlaceDetailsRequest *placeDetailsRequest = [[HIPlaceDetailsRequest alloc] init];
placeDetailsRequest.key = @"YOUR_KEY_HERE";
placeDetailsRequest.placeId = @"ChIJD7fiBh9u5kcRYJSMaMOCCwQ";
[_placesManager searchForPlaceDetailsResultWithRequest:placeDetailsRequest];

4. Set up HIPlacesManagerDelegate protocol methods to handle results

- (void)placesManager:(HIPlacesManager *)placesManager didSearchForPlaceAutocompleteResults:(NSArray *)placeAutocompleteResults
{
    # Do stuff with placeAutocompleteResults
}

- (void)placesManager:(HIPlacesManager *)placesManager searchForPlaceAutocompleteResultsDidFailWithError:(NSError *)error
{
    # Handle error
}

- (void)placesManager:(HIPlacesManager *)placesManager didSearchForPlaceDetailsResult:(HIPlaceDetailsResult *)placeDetailsResult
{
    # Do stuff with placeDetailsResult
}

- (void)placesManager:(HIPlacesManager *)placesManager searchForPlaceDetailsResultDidFailWithError:(NSError *)error
{
    # Handle error
}

Installation

HIPlaces is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "HIPlaces"

Author

Hozefa Indorewala, [email protected]

License

HIPlaces is available under the MIT license. See the LICENSE file for more info.

hiplaces's People

Contributors

hozefa26 avatar

Watchers

 avatar

hiplaces's Issues

Hello from Manu Perez Prada

Hey Hoze,

how you doing? Stephan here on behalf of Manu. He asked if you received his email. Hope you doing well.

Best greetings from Manu

Cheers from Munich

Stephan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.