#Foursquare API 2.0 For iOS and MacOS
###Features
- In-App Authentication
- Asynchronous requests with blocks
- Build-in image uploader for photos.
- You can use CFAsyncImageView for downloading images.
- Made with native framworks:
- NSJSONSerialization for JSON parsing
- NSURLConnection for requests
###How To
-
Create Your application here https://foursquare.com/developers/register
-
Setup Foursquare to use your credentials
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Foursquare2 setupFoursquareWithKey:YOUR_KEY secret:YOUR_SECRET callbackURL:YOUR_CALLBACK_URL]; }
-
You need to make sure you set up the URL scheme in your info.plist properly
CFBundleURLTypes -> CFBundleURLName -> CFBundleURLSchemes -> {app_id}
###Usefull tips
-
How to get sw and ne from MKMapView?
CGPoint swPoint = CGPointMake(mapView.bounds.origin.x, mapView.bounds.origin.y+ mapView.bounds.size.height); CGPoint nePoint = CGPointMake((mapView.bounds.origin.x + mapView.bounds.size.width), (mapView.bounds.origin.y)); //Then transform those point into lat,lng values CLLocationCoordinate2D swCoord; swCoord = [mapView convertPoint:swPoint toCoordinateFromView:mapView]; CLLocationCoordinate2D neCoord; neCoord = [mapView convertPoint:nePoint toCoordinateFromView:mapView];
##My other usefull libs CFAsyncImageView - is simple subclass of UIImageView for async downloading image. Very simple and powerfull. No extra code. I use native NSCache class for in-memory image caching.
I got blue pin here.