2012-07-22 14:23:50 -07:00
|
|
|
//
|
|
|
|
// FTUXAddFriendsViewController.m
|
|
|
|
// NewsBlur
|
|
|
|
//
|
|
|
|
// Created by Roy Yang on 7/22/12.
|
|
|
|
// Copyright (c) 2012 NewsBlur. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "FirstTimeUserAddFriendsViewController.h"
|
|
|
|
#import "FirstTimeUserAddNewsBlurViewController.h"
|
2012-08-10 21:10:32 -07:00
|
|
|
#import "AuthorizeServicesViewController.h"
|
2012-07-22 14:23:50 -07:00
|
|
|
|
|
|
|
@interface FirstTimeUserAddFriendsViewController ()
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation FirstTimeUserAddFriendsViewController
|
|
|
|
|
|
|
|
@synthesize appDelegate;
|
|
|
|
@synthesize nextButton;
|
2012-08-10 21:10:32 -07:00
|
|
|
@synthesize facebookButton;
|
|
|
|
@synthesize twitterButton;
|
2012-07-22 14:23:50 -07:00
|
|
|
|
|
|
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
|
|
|
{
|
|
|
|
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
|
|
|
if (self) {
|
|
|
|
// Custom initialization
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (void)viewDidLoad {
|
2012-07-22 14:23:50 -07:00
|
|
|
[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;
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
self.navigationItem.title = @"Step 3 of 4";
|
2012-07-22 14:23:50 -07:00
|
|
|
}
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (void)viewDidUnload {
|
2012-07-22 14:23:50 -07:00
|
|
|
[self setNextButton:nil];
|
2012-08-10 21:10:32 -07:00
|
|
|
[self setFacebookButton:nil];
|
|
|
|
[self setTwitterButton:nil];
|
2012-07-22 14:23:50 -07:00
|
|
|
[super viewDidUnload];
|
|
|
|
// Release any retained subviews of the main view.
|
|
|
|
// e.g. self.myOutlet = nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
2012-07-22 14:23:50 -07:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)tapNextButton {
|
|
|
|
[appDelegate.ftuxNavigationController pushViewController:appDelegate.firstTimeUserAddNewsBlurViewController animated:YES];
|
|
|
|
}
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (IBAction)tapTwitterButton {
|
|
|
|
AuthorizeServicesViewController *service = [[AuthorizeServicesViewController alloc] init];
|
|
|
|
service.url = @"/oauth/twitter_connect";
|
|
|
|
service.type = @"twitter";
|
|
|
|
[appDelegate.ftuxNavigationController pushViewController:service animated:YES];
|
2012-07-22 14:23:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (IBAction)tapFacebookButton {
|
|
|
|
AuthorizeServicesViewController *service = [[AuthorizeServicesViewController alloc] init];
|
|
|
|
service.url = @"/oauth/facebook_connect";
|
|
|
|
service.type = @"facebook";
|
|
|
|
[appDelegate.ftuxNavigationController pushViewController:service animated:YES];
|
2012-07-22 14:23:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (void)selectTwitterButton {
|
|
|
|
self.twitterButton.selected = YES;
|
|
|
|
self.twitterButton.userInteractionEnabled = NO;
|
2012-07-22 14:23:50 -07:00
|
|
|
}
|
|
|
|
|
2012-08-10 21:10:32 -07:00
|
|
|
- (void)selectFacebookButton {
|
|
|
|
self.facebookButton.selected = YES;
|
|
|
|
self.facebookButton.userInteractionEnabled = NO;
|
2012-07-22 14:23:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@end
|