TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Apr 2015 |
Maintained by alexruperez.
Foursquare search controller with suggest completion like Instagram.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Call + (void)configureWithClientID:(NSString *)clientID clientSecret:(NSString *)clientSecret redirectURI:(NSString *)redirectURI
[FSNetworkingSearchController configureWithClientID:@"YOUR_CLIENT_ID" clientSecret:@"YOUR_CLIENT_SECRET" redirectURI:@"YOUR_REDIRECT_URI"];
If you need to login for accurated results call + (void)loginWithCompletion:(FSNSCAccessTokenBlock)completion
and put + (BOOL)handleOpenURL:(NSURL *)handledURL
in your - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [FSNetworkingSearchController handleOpenURL:url];
}
[FSNetworkingSearchController loginWithCompletion:^(NSString *accessToken, NSError *error) {
NSLog(@"DO STUFF");
}];
FSNetworkingSearchController automatically gets the user location if you don't already do it, only put NSLocationWhenInUseUsageDescription
key in your plist. But you could force to use a custom CLLocation with the method + (void)forceLocation:(CLLocation *)location
, for example if you what to use the metadata of an image.
Use it as your UISearchDisplayController delegate, UISearchController searchResultsUpdater or your UITableView dataSource and delegate. Your could do it programmatically or using the storyboard like in the example project. Have IBInspectable properties.
You could customize it or set the selectHandler to detect selected Foursquare Venue.
I use foursquare/FSNetworking to make the API requests, but it's a protocol, you can inject your own to the FSNetworkingSearchController or mock it if you need.
Tweet the author @alexruperez, and check out alexruperez's blog: http://alexruperez.com
FSNetworkingSearchController is available under the MIT license. See the LICENSE file for more info.