forked from xxhp/NGTabBarController
/
AppDelegate.m
51 lines (39 loc) · 2.01 KB
/
AppDelegate.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
//
// AppDelegate.m
// NGTabBarControllerDemo
//
// Created by Tretter Matthias on 16.02.12.
// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved.
//
#import "AppDelegate.h"
#import "NGColoredViewController.h"
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
NSArray *viewController = [NSArray arrayWithObjects:[[NGColoredViewController alloc] initWithNibName:nil bundle:nil],
[[NGColoredViewController alloc] initWithNibName:nil bundle:nil],
[[NGColoredViewController alloc] initWithNibName:nil bundle:nil],
[[NGColoredViewController alloc] initWithNibName:nil bundle:nil],
[[NGColoredViewController alloc] initWithNibName:nil bundle:nil],nil];
NGTabBarController *tabBarController = [[NGTabBarController alloc] initWithDelegate:self];
tabBarController.animation = NGTabBarControllerAnimationMoveAndScale;
tabBarController.viewControllers = viewController;
self.window.rootViewController = tabBarController;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
////////////////////////////////////////////////////////////////////////
#pragma mark - NGTabBarControllerDelegate
////////////////////////////////////////////////////////////////////////
- (NGTabBarItem *)verticalTabBarController:(NGTabBarController *)tabBarController
customizedItem:(NGTabBarItem *)item
forViewController:(UIViewController *)viewController
atIndex:(NSUInteger)index {
item.textLabel.text = [NSString stringWithFormat:@"%d", index];
return item;
}
@end