/Foursquare-API-v2

Foursquare API v2 For iOS and MacOS

Primary LanguageObjective-CMIT LicenseMIT

#Foursquare API 2.0 For iOS and MacOS

###Features

  • In-App Authentication
  • Asynchronous requests with blocks
  • Build-in image uploader for photos.
  • Made with native framworks:
    • NSJSONSerialization for JSON parsing
    • NSURLConnection for requests

###How To

  1. Create Your application here https://foursquare.com/developers/register

  2. You should modify Foursquare2.h

    1. Change FS2_OAUTH_KEY and FS2_OAUTH_SECRET
    2. Change FS2_REDIRECT_URL. It should start with app://
    3. Change FS2_API_VERSION to your current date, so you will use latest API/
  3. You need to make sure you set up the URL scheme in your info.plist properly

CFBundleURLTypes -> CFBundleURLName -> CFBundleURLSchemes -> {app_id}

###Usefull tips

  1. 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];
    

###Screnshots

##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.