Created
April 19, 2013 00:41
-
-
Save keithelliott/5417326 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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