-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiViewController.m
More file actions
executable file
·86 lines (71 loc) · 2.06 KB
/
MultiViewController.m
File metadata and controls
executable file
·86 lines (71 loc) · 2.06 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
// MultiViewController.m
// TypingGame
//
// Created by Jacopo Volpin on 17/05/10.
// Copyright 2010 UniPD. All rights reserved.
//
#import "MultiViewController.h"
#import "MenuViewController.h"
#import "SettingViewController.h"
#import "PlayViewController.h"
#import "UpdateViewController.h"
#import "BillBoardsViewController.h"
UIViewController *currentView;
@implementation MultiViewController
- (void) displayView:(int)intNewView {
NSLog(@"%i", intNewView);
[currentView.view removeFromSuperview];
[currentView release];
switch (intNewView) {
case 1:
currentView = [[MenuViewController alloc] init];
break;
case 2:
currentView = [[SettingViewController alloc] init];
break;
case 3:
currentView = [[PlayViewController alloc] init];
break;
case 4:
currentView = [[MenuViewController alloc] init];
break;
case 5:
currentView = [[UpdateViewController alloc] init];
break;
case 6:
currentView = [[BillBoardsViewController alloc] init];
break;
}
[UIView beginAnimations:@"split" context:nil];
[UIView setAnimationDuration:1.0];
[self.view addSubview:currentView.view];
if (intNewView==1 || intNewView==5 || intNewView==6) {
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
}
if (intNewView==2) {
[UIView setAnimationTransition:UIViewAnimationCurveEaseOut forView:self.view cache:YES];
}
if (intNewView==3) {
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
}
if (intNewView==4) {
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
}
[UIView commitAnimations];
}
- (void)viewDidLoad {
// display Welcome screen
currentView = [[MenuViewController alloc] init];
[self.view addSubview:currentView.view];
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)dealloc {
[super dealloc];
}
@end