// // FTUXAddFriendsViewController.m // NewsBlur // // Created by Roy Yang on 7/22/12. // Copyright (c) 2012 NewsBlur. All rights reserved. // #import "FirstTimeUserAddFriendsViewController.h" #import "FirstTimeUserAddNewsBlurViewController.h" #import "AuthorizeServicesViewController.h" @interface FirstTimeUserAddFriendsViewController () @end @implementation FirstTimeUserAddFriendsViewController @synthesize appDelegate; @synthesize nextButton; @synthesize facebookButton; @synthesize twitterButton; @synthesize facebookActivityIndicator; @synthesize twitterActivityIndicator; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. UIBarButtonItem *next = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonSystemItemDone target:self action:@selector(tapNextButton)]; self.nextButton = next; self.navigationItem.rightBarButtonItem = next; self.navigationItem.title = @"Step 3 of 4"; } - (void)viewDidUnload { [self setNextButton:nil]; [self setFacebookButton:nil]; [self setTwitterButton:nil]; [self setFacebookActivityIndicator:nil]; [self setTwitterActivityIndicator:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { return YES; } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) { return YES; } return NO; } - (IBAction)tapNextButton { [appDelegate.ftuxNavigationController pushViewController:appDelegate.firstTimeUserAddNewsBlurViewController animated:YES]; } - (IBAction)tapTwitterButton { AuthorizeServicesViewController *service = [[AuthorizeServicesViewController alloc] init]; service.url = @"/oauth/twitter_connect"; service.type = @"twitter"; [appDelegate.ftuxNavigationController pushViewController:service animated:YES]; } - (IBAction)tapFacebookButton { AuthorizeServicesViewController *service = [[AuthorizeServicesViewController alloc] init]; service.url = @"/oauth/facebook_connect"; service.type = @"facebook"; [appDelegate.ftuxNavigationController pushViewController:service animated:YES]; } - (void)selectTwitterButton { self.twitterButton.selected = YES; self.twitterButton.userInteractionEnabled = NO; } - (void)selectFacebookButton { self.facebookButton.selected = YES; self.facebookButton.userInteractionEnabled = NO; } @end