-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistoryViewController.m
More file actions
105 lines (79 loc) · 3.28 KB
/
HistoryViewController.m
File metadata and controls
105 lines (79 loc) · 3.28 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
//
// HistoryViewController.m
// CarServiceProject
//
// Created by NetSet on 4/1/15.
// Copyright (c) 2015 NetSet. All rights reserved.
//
#import "HistoryViewController.h"
#import "CustomHistoryCell.h"
#import "SWRevealViewController.h"
@interface HistoryViewController ()
@end
@implementation HistoryViewController
{
NSArray *arrCarMake;
NSArray *arrCarModel;
NSArray *arrImages;
NSArray *arrVehicle;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
arrCarMake=@[@"chevrolet",@"Fiat",@"Force",@"Ford",@"Honda"];
arrCarModel=@[@"2000",@"2001",@"2005",@"2008",@"2009"];
arrVehicle=@[@"7100",@"1974",@"4100",@"5647",@"1669"];
arrImages=@[@"black-laye.png",@"map.png",@"pick-address-tab.png",@"submit.png",@"bg.png"];
// _tblHistoryView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]];
// Change button color
_sideButtonHistory.tintColor = [UIColor blackColor];
_sideButtonHistory.target = self.revealViewController;
_sideButtonHistory.action = @selector(revealToggle:);
// Set the gesture
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}
-(void)viewWillAppear:(BOOL)animated
{
self.navigationController.navigationBarHidden = YES;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#pragma mark -Tabledatasource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
return arrCarMake.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"cell";
CustomHistoryCell *cell = (CustomHistoryCell*)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomHistoryCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.backgroundColor=[UIColor clearColor];
// cell.lblCarMake.text = [arrCarModel objectAtIndex:indexPath.row];
// cell.lblCarModel.text = [ arrCarModel objectAtIndex:indexPath.row];
// cell.lblVehicle.text =[arrVehicle objectAtIndex:indexPath.row];
cell.imgHistory.image=[UIImage imageNamed:[arrImages objectAtIndex:indexPath.row]];
cell.lblVehicle.text = [NSString stringWithFormat:@"%@ %@",@"VehicleNo.:", [arrVehicle objectAtIndex:indexPath.row]];
cell.lblCarMake.text = [NSString stringWithFormat:@"%@ %@",@"CarMake:", [arrCarMake objectAtIndex:indexPath.row]];
cell.lblCarModel.text = [NSString stringWithFormat:@"%@ %@",@"CarModel:", [arrCarModel objectAtIndex:indexPath.row]];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"push_detail" sender:self];
}
@end