#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
-
You should modify Foursquare2.h
- Change OAUTH_KEY and OAUTH_SECRET
- Change REDIRECT_URL. It should start with app://
- Change VERSION to your current date, so you will use latest API/
-
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.