-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeftMenuViewController.m
More file actions
executable file
·121 lines (96 loc) · 3.64 KB
/
Copy pathLeftMenuViewController.m
File metadata and controls
executable file
·121 lines (96 loc) · 3.64 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
// MenuViewController.m
// SlideMenu
//
// Created by Aryan Gh on 4/24/13.
// Copyright (c) 2013 Aryan Ghassemi. All rights reserved.
//
#import "LeftMenuViewController.h"
#import "SlideNavigationContorllerAnimatorFade.h"
#import "SlideNavigationContorllerAnimatorSlide.h"
#import "SlideNavigationContorllerAnimatorScale.h"
#import "SlideNavigationContorllerAnimatorScaleAndFade.h"
#import "SlideNavigationContorllerAnimatorSlideAndFade.h"
#import "LeftMenuTableViewCell.h"
@interface LeftMenuViewController ()
@property (strong, nonatomic) NSArray *arrMenuImage;
@end
@implementation LeftMenuViewController
#pragma mark - UIViewController Methods -
- (id)initWithCoder:(NSCoder *)aDecoder
{
self.slideOutAnimationEnabled = YES;
return [super initWithCoder:aDecoder];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.separatorColor = [UIColor lightGrayColor];
self.arrMenuImage = @[@"home", @"mine", @"money_call", @"money_send"];
//UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menu"]];
//self.tableView.backgroundView = imageView;
}
#pragma mark - UITableView Delegate & Datasrouce -
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrMenuImage.count;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 20)];
view.backgroundColor = [UIColor clearColor];
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
LeftMenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"leftMenuCell"];
cell.menuImageView.image = [UIImage imageNamed:[self.arrMenuImage objectAtIndex:indexPath.row]];
switch (indexPath.row) {
case 0:
cell.menuNameLabel.text = @"메인화면";
break;
case 1:
cell.menuNameLabel.text = @"받을 돈 요청하기";
break;
case 2:
cell.menuNameLabel.text = @"보낼 돈 요청하기";
break;
case 3:
cell.menuNameLabel.text = @"나의 거래내역 조회";
break;
}
cell.backgroundColor = [UIColor clearColor];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main"
bundle: nil];
UIViewController *vc ;
switch (indexPath.row) {
case 0:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"MainViewController"];
break;
case 1:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"RequestReceiveMoneyVC"];
break;
case 2:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"RequestSendingMoneyVC"];
break;
case 3:
vc = [mainStoryboard instantiateViewControllerWithIdentifier: @"MyTradeInquireVC"];
break;
case 4:
//[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
//[[SlideNavigationController sharedInstance] popToRootViewControllerAnimated:YES];
//return;
break;
}
[[SlideNavigationController sharedInstance] popToRootAndSwitchToViewController:vc withSlideOutAnimation:NO andCompletion:nil];
//[[SlideNavigationController sharedInstance] popToRootAndSwitchToViewController:vc
//withSlideOutAnimation:self.slideOutAnimationEnabled
//andCompletion:nil];
}
@end