Created
October 11, 2011 04:56
-
-
Save alex-ethier/1277331 to your computer and use it in GitHub Desktop.
SimpleGeo.framework - IOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SGCallback *callback = [SGCallback callbackWithSuccessBlock: | |
^(id response) | |
{ | |
NSLog(@"Handle Success"); | |
} failureBlock:^(NSError *error) | |
{ | |
NSLog(@"Handle Failure"); | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <SimpleGeo/SimpleGeo.h> | |
SimpleGeo *client = [[SimpleGeo clientWithConsumerKey:SimpleGeoOAuthKey | |
consumerSecret:SimpleGeoOAuthSecret] retain]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client getPlacesForQuery:query callback:callback]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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