2012-06-13 18:07:24 -07:00
//
// FirstTimeUserViewController . m
// NewsBlur
//
// Created by Roy Yang on 6 / 13 / 12.
// Copyright ( c ) 2012 NewsBlur . All rights reserved .
//
# import "FirstTimeUserViewController.h"
# import "NewsBlurAppDelegate.h"
2012-06-15 15:02:30 -07:00
# import "ASIHTTPRequest.h"
2012-07-22 14:23:50 -07:00
# import "FirstTimeUserAddSitesViewController.h"
2012-06-13 18:07:24 -07:00
2012-06-15 10:49:51 -07:00
# define WELCOME_BUTTON _TITLE @ "LET'S GET STARTED"
2012-06-15 15:02:30 -07:00
# define ADD_SITES _SKIP _BUTTON _TITLE @ "SKIP THIS STEP"
# define ADD_SITES _BUTTON _TITLE @ "NEXT"
2012-06-15 10:49:51 -07:00
# define ADD_FRIENDS _BUTTON _TITLE @ "SKIP THIS STEP"
# define ADD_NEWSBLUR _BUTTON _TITLE @ "FINISH"
2012-06-13 18:07:24 -07:00
@ implementation FirstTimeUserViewController
2012-06-15 10:49:51 -07:00
@ synthesize appDelegate ;
2012-06-15 15:02:30 -07:00
@ synthesize nextButton ;
2012-06-20 07:39:49 -07:00
@ synthesize logo ;
2012-06-14 10:19:36 -07:00
2012-06-13 18:07:24 -07:00
- ( 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 .
2012-07-22 14:23:50 -07:00
UIBarButtonItem * next = [ [ UIBarButtonItem alloc ] initWithTitle : @ "Let's get started" style : UIBarButtonSystemItemDone target : self action : @ selector ( tapNextButton ) ] ;
self . nextButton = next ;
self . navigationItem . rightBarButtonItem = next ;
self . navigationItem . title = @ "Step 1 of 4" ;
2012-06-13 18:07:24 -07:00
}
- ( void ) viewDidUnload
{
2012-06-15 15:02:30 -07:00
[ self setNextButton : nil ] ;
2012-06-20 07:39:49 -07:00
[ self setLogo : nil ] ;
2012-06-13 18:07:24 -07:00
[ super viewDidUnload ] ;
// Release any retained subviews of the main view .
// e . g . self . myOutlet = nil ;
}
2012-06-20 07:39:49 -07:00
- ( void ) viewWillAppear : ( BOOL ) animated {
[ self rotateLogo ] ;
}
2012-07-22 14:23:50 -07:00
- ( void ) viewDidAppear : ( BOOL ) animated {
}
2012-06-13 18:07:24 -07:00
- ( BOOL ) shouldAutorotateToInterfaceOrientation : ( UIInterfaceOrientation ) interfaceOrientation
{
return YES ;
}
2012-06-14 10:19:36 -07:00
2012-06-15 15:02:30 -07:00
- ( IBAction ) tapNextButton {
2012-07-22 14:23:50 -07:00
[ appDelegate . ftuxNavigationController pushViewController : appDelegate . firstTimeUserAddSitesViewController animated : YES ] ;
2012-06-15 16:35:54 -07:00
}
2012-06-15 15:02:30 -07:00
2012-06-20 07:39:49 -07:00
- ( void ) rotateLogo {
// Setup the animation
[ UIView beginAnimations : nil context : NULL ] ;
[ UIView setAnimationDuration : ( NSTimeInterval ) 60.0 ] ;
[ UIView setAnimationCurve : UIViewAnimationCurveLinear ] ;
[ UIView setAnimationBeginsFromCurrentState : YES ] ;
NSLog ( @ "%f" , M_PI ) ;
// The transform matrix
CGAffineTransform transform = CGAffineTransformMakeRotation ( 3.14 ) ;
self . logo . transform = transform ;
// Commit the changes
[ UIView commitAnimations ] ;
}
2012-06-13 18:07:24 -07:00
@ end