-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSplashController.m
59 lines (45 loc) · 1.38 KB
/
SplashController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// SplashController.m
// MusicOneCoreData
//
// Created by Bobby Wallace on 03/31/2010.
// Copyright 2010 Total Managed Fitness. All rights reserved.
//
#import "SplashController.h"
@implementation SplashController
@synthesize wallpaper;
@synthesize logoView;
- (UIImage *) wallPaperImage:(UIInterfaceOrientation)forInterfaceOrientation {
return (UIInterfaceOrientationIsPortrait(forInterfaceOrientation)) ?
[UIImage imageNamed:@"SplashWP.png"] :
[UIImage imageNamed:@"SplashWL.png"];
}
- (void)viewDidLoad {
[super viewDidLoad];
wallpaper.image = [self wallPaperImage:[self interfaceOrientation]];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
wallpaper.image = [self wallPaperImage:toInterfaceOrientation];
// NSLog(@"center = %@", NSStringFromCGRect(wallpaper.bounds));
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
logoView.center = CGPointMake(160.0,208.0);
} else {
logoView.center = CGPointMake(240.0,128.0);
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
self.wallpaper = nil;
self.logoView = nil;
}
- (void)dealloc {
[wallpaper release];
[logoView release];
[super dealloc];
}
@end