Skip to content

Instantly share code, notes, and snippets.

@keithelliott
Created April 19, 2013 00:41
Show Gist options
  • Save keithelliott/5417326 to your computer and use it in GitHub Desktop.
Save keithelliott/5417326 to your computer and use it in GitHub Desktop.
#import "ViewController.h"
#import "FoursquareAuthentication.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
//check for foursquare and authorize
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if(![defaults objectForKey:@"access_token"]){
[self.connectToFoursquare setHidden:NO];
}
else{
[self.connectToFoursquare setHidden:YES];
}
}
- (IBAction)connect:(id)sender {
FoursquareAuthentication *controller = [[FoursquareAuthentication alloc] init];
[self presentViewController:controller animated:NO completion:nil];
[self.connectToFoursquare setHidden:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment