Skip to content

Commit

Permalink
Fixing syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
spoletto committed Jul 18, 2012
1 parent 0c40dd7 commit 9c12ed8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ SPGooglePlacesAutocomplete requires a deployment target >= iOS 5.0.

### Performing Queries

Instantiate a new `SPGooglePlacesAutocompleteQuery` and fill in the properties you'd like to specify.
Instantiate a new SPGooglePlacesAutocompleteQuery and fill in the properties you'd like to specify.

```Objective-C
``` objective-c
#import "SPGooglePlacesAutocompleteQuery.h"

...
Expand All @@ -45,21 +45,21 @@ Instantiate a new `SPGooglePlacesAutocompleteQuery` and fill in the properties y
query.location = CLLocationCoordinate2DMake(37.76999, -122.44696);
```

Then, call `-fetchPlaces` to ping Google's API and fetch results. The resulting array will return objects of the `SPGooglePlacesAutocompletePlace` class.
Then, call -fetchPlaces to ping Google's API and fetch results. The resulting array will return objects of the SPGooglePlacesAutocompletePlace class.

```Objective-C
``` objective-c
[query fetchPlaces:^(NSArray *places, NSError *error) {
NSLog(@"Places returned %@", places);
}];
```

If you need to update the query (for instance, as the user types), simply update the appropriate properties and call `-fetchPlaces` again. Any outstanding requests will automatically be cancelled and a new request with the updated properties will be issued.
If you need to update the query (for instance, as the user types), simply update the appropriate properties and call -fetchPlaces again. Any outstanding requests will automatically be cancelled and a new request with the updated properties will be issued.

### Resolving Places to CLPlacemarks

The Google Places Autocomplete API will return the names of Places that match your query. It will not, however, return lat-long information about these results. SPGooglePlacesAutocomplete handles this by resolving Place results to placemarks. Simply call `-resolveToPlacemark` on a `SPGooglePlacesAutocompletePlace`:
The Google Places Autocomplete API will return the names of Places that match your query. It will not, however, return lat-long information about these results. SPGooglePlacesAutocomplete handles this by resolving Place results to placemarks. Simply call -resolveToPlacemark on a SPGooglePlacesAutocompletePlace:

```Objective-C
``` objective-c
[query fetchPlaces:^(NSArray *places, NSError *error) {
SPGooglePlacesAutocompletePlace *place = [places firstObject];
if (place) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "SPGooglePlacesAutocompleteUtilities.h"
#endif
2 changes: 2 additions & 0 deletions SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <CoreLocation/CoreLocation.h>

#import "SPGooglePlacesAutocompleteUtilities.h"

@interface SPGooglePlacesAutocompletePlace : NSObject {
CLGeocoder *geocoder;
}
Expand Down
2 changes: 2 additions & 0 deletions SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <CoreLocation/CoreLocation.h>

#import "SPGooglePlacesAutocompleteUtilities.h"

@interface SPGooglePlacesAutocompleteQuery : NSObject {
NSURLConnection *googleConnection;
NSMutableData *responseData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}

cell.textLabel.font = [UIFont fontWithName:@"GillSans" size:16.0];
cell.textLabel.text = [self placeAtIndexPath:indexPath].name;
return cell;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2012 Stephen Poletto. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SPGooglePlacesAutocompleteUtilities.h"

@interface SPGooglePlacesPlaceDetailQuery : NSObject {
NSURLConnection *googleConnection;
Expand Down

0 comments on commit 9c12ed8

Please sign in to comment.