NewsBlur/media/ios/Classes/FirstTimeUserAddFriendsViewController.m
2012-08-10 21:10:32 -07:00

90 lines
2.4 KiB
Objective-C

//
// 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;
- (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];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
- (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