-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainTabView.m
More file actions
94 lines (79 loc) · 3 KB
/
MainTabView.m
File metadata and controls
94 lines (79 loc) · 3 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
87
88
89
90
91
92
93
94
//
// AppView2.m
// Purge
//
// Created by Ryan Nystrom on 2/18/12.
// Copyright (c) 2012 Topic Design. All rights reserved.
//
#import "MainTabView.h"
@implementation MainTabView
-(void)dealloc
{
[super dealloc];
}
-(id)init
{
if (self = [super init]) {
Home *home = [[Home alloc] init];
[[home tabBarItem] setTitle:@"Feed"];
UIImage *homeImage = [UIImage imageNamed:@"feed_icon.png"];
[[home tabBarItem] setImage:homeImage];
About *about = [[About alloc] initWithStyle:UITableViewStyleGrouped];
[[about tabBarItem] setTitle:@"Account"];
UIImage *aboutImage = [UIImage imageNamed:@"account_icon.png"];
[[about tabBarItem] setImage:aboutImage];
MyPurge *myPurge = [[MyPurge alloc] init];
[[myPurge tabBarItem] setTitle:@"My Purges"];
UIImage *myPurgeImage = [UIImage imageNamed:@"browse_icon.png"];
[[myPurge tabBarItem] setImage:myPurgeImage];
// Browse *browse = [[Browse alloc] initWithStyle:UITableViewStylePlain];
// [[browse tabBarItem] setTitle:@"Browse"];
// UIImage *browseImage = [UIImage imageNamed:@"notification_icon.png"];
// [[browse tabBarItem] setImage:browseImage];
Purge *purge = [[Purge alloc] init];
[[purge tabBarItem] setTitle:@"Purge"];
UIImage *purgeImage = [UIImage imageNamed:@"plus_icon.png"];
[[purge tabBarItem] setImage:purgeImage];
UIImage *image = [UIImage imageNamed:@"logo_topbar.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[[self navigationItem] setTitleView:imageView];
[imageView release];
[self setViewControllers:[NSArray arrayWithObjects:home, purge, myPurge, about, nil] animated:NO];
[home release], home = nil;
[purge release], purge = nil;
[about release], about = nil;
[myPurge release], myPurge = nil;
// [browse release], browse = nil;
}
return self;
}
- (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.
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[[self tabBarController] navigationController] setNavigationBarHidden:NO animated:animated];
[[[self tabBarController] navigationController] setToolbarHidden:YES animated:animated];
[[[self tabBarController] navigationItem] setHidesBackButton:YES];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end