Skip to content

Instantly share code, notes, and snippets.

@alex-ethier
Created October 11, 2011 04:56
Show Gist options
  • Save alex-ethier/1277331 to your computer and use it in GitHub Desktop.
Save alex-ethier/1277331 to your computer and use it in GitHub Desktop.
SimpleGeo.framework - IOS
SGCallback *callback = [SGCallback callbackWithSuccessBlock:
^(id response)
{
NSLog(@"Handle Success");
} failureBlock:^(NSError *error)
{
NSLog(@"Handle Failure");
}];
#import <SimpleGeo/SimpleGeo.h>
SimpleGeo *client = [[SimpleGeo clientWithConsumerKey:SimpleGeoOAuthKey
consumerSecret:SimpleGeoOAuthSecret] retain];
[client getPlacesForQuery:query callback:callback];
#import <SimpleGeo/SimpleGeo.h>
// Replace SimpleGeoOAuthKey by your Key
// Replace SimpleGeoOAuthSecret by your Secret
SimpleGeo *client = [[SimpleGeo clientWithConsumerKey:SimpleGeoOAuthKey
consumerSecret:SimpleGeoOAuthSecret] retain];
SGPlacesQuery *query = [SGPlacesQuery queryWithPoint:[SGPoint pointWithLat:37.772445 lon:-122.405913]];
SGCallback *callback = [SGCallback callbackWithSuccessBlock:
^(id response)
{
NSLog(@"Handle Success");
NSArray *places = [NSArray arrayWithSGCollection:response type:SGCollectionTypePlaces];
NSLog(@"%i places", [places count]);
for (SGPlace *place in places)
{
NSLog(@"%@", place);
}
} failureBlock:^(NSError *error)
{
NSLog(@"Handle Failure");
}];
[client getPlacesForQuery:query callback:callback];
SGPlacesQuery *query = [SGPlacesQuery queryWithPoint:[SGPoint pointWithLat:37.772445 lon:-122.405913]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment