-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewController.m
64 lines (52 loc) · 2.1 KB
/
ViewController.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
60
61
62
63
64
//
// ViewController.m
// Transfer
//
// Created by mengyan.luo on 13-10-17.
// Copyright (c) 2013年 MTime. All rights reserved.
//
static NSInteger count;
#import "ViewController.h"
#import "HorizontalCubeView.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[_button setTitle:[NSString stringWithFormat:@"%d", count++] forState:UIControlStateNormal];
}
- (IBAction)btnPressed:(id)sender
{
NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
ViewController *vc1 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc1.view.backgroundColor = [UIColor blackColor];
[array addObject:vc1.view];
ViewController *vc2 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc2.view.backgroundColor = [UIColor redColor];
[array addObject:vc2.view];
ViewController *vc3 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc3.view.backgroundColor = [UIColor blueColor];
[array addObject:vc3.view];
ViewController *vc4 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc4.view.backgroundColor = [UIColor greenColor];
[array addObject:vc4.view];
ViewController *vc5 = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
vc5.view.backgroundColor = [UIColor yellowColor];
[array addObject:vc5.view];
HorizontalCubeView *view = [[HorizontalCubeView alloc] initWithViews:array frame:self.view.bounds];
[self.view addSubview:view];
// ViewController *vc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
// [self transitionFromViewController:self toViewController:vc duration:4 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
// [self.view addSubview:vc.view];
// } completion:^(BOOL finished) {
//
// }];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end