Skip to content

Commit

Permalink
removed image view from class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayson Lane committed Mar 8, 2012
1 parent 80a32bd commit 7024ad7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Binary file not shown.
3 changes: 0 additions & 3 deletions OpenBook/AppDelegate.h
Expand Up @@ -12,13 +12,10 @@
@interface AppDelegate : UIResponder <UIApplicationDelegate> { @interface AppDelegate : UIResponder <UIApplicationDelegate> {




UIImageView *splashImage;




} }


@property (nonatomic, retain) UIImageView *splashImage;

@property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UIWindow *window;


@property (strong, nonatomic) ViewController *viewController; @property (strong, nonatomic) ViewController *viewController;
Expand Down
21 changes: 13 additions & 8 deletions OpenBook/AppDelegate.m
Expand Up @@ -13,7 +13,6 @@


@implementation AppDelegate @implementation AppDelegate


@synthesize splashImage;
@synthesize window = _window; @synthesize window = _window;
@synthesize viewController = _viewController; @synthesize viewController = _viewController;


Expand All @@ -26,24 +25,30 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];




// Add the image to the forefront... //add the image to the forefront...
splashImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; UIImageView *splashImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[splashImage setImage: [UIImage imageNamed:@"Default"]]; [splashImage setImage: [UIImage imageNamed:@"Default"]];
[self.window addSubview:splashImage]; [self.window addSubview:splashImage];
[self.window bringSubviewToFront:splashImage]; [self.window bringSubviewToFront:splashImage];


self.splashImage.layer.anchorPoint = CGPointMake(0, 0.5);
self.splashImage.frame = CGRectMake(0, 0, 320, 480);


//set an anchor point on the image view so it opens from the left
splashImage.layer.anchorPoint = CGPointMake(0, 0.5);

//reset the image view frame
splashImage.frame = CGRectMake(0, 0, 320, 480);

//animate the open
[UIView animateWithDuration:1.0 [UIView animateWithDuration:1.0
delay:0.6 delay:0.6
options:(UIViewAnimationCurveEaseOut) options:(UIViewAnimationCurveEaseOut)
animations:^{ animations:^{


self.splashImage.layer.transform = CATransform3DRotate(CATransform3DIdentity, -M_PI_2, 0, 1, 0); splashImage.layer.transform = CATransform3DRotate(CATransform3DIdentity, -M_PI_2, 0, 1, 0);
} completion:^(BOOL finished){ } completion:^(BOOL finished){
// completion code
[self.splashImage removeFromSuperview]; //remove that imageview from the view
[splashImage removeFromSuperview];
}]; }];


return YES; return YES;
Expand Down

0 comments on commit 7024ad7

Please sign in to comment.