Blame view
LifeLog/LifeLog/RankingViewController.m
3.57 KB
|
77358f2e0
|
1 2 3 4 5 6 7 8 9 |
// // RankingViewController.m // LifeLog // // Created by Nguyen Van Phong on 7/25/17. // Copyright © 2017 PhongNV. All rights reserved. // #import "RankingViewController.h" |
|
7f9c2f9ce
|
10 |
#import "RankingTableViewCell.h" |
|
77358f2e0
|
11 12 13 14 15 16 17 18 19 20 |
@interface RankingViewController ()
@end
@implementation RankingViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
|
|
7f9c2f9ce
|
21 |
self.title = NSLocalizedString(@"lifelog.rank.title", nil); |
|
7f9c2f9ce
|
22 23 24 25 26 |
[self setupView];
//register nib for table view
[self.tableRank registerNib:[UINib nibWithNibName:@"RankingTableViewCell" bundle:nil] forCellReuseIdentifier:@"RankCell"];
|
|
77358f2e0
|
27 28 29 30 31 32 |
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
|
|
7f9c2f9ce
|
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 |
#pragma mark Setup and Update View
- (void)setupView {
NSArray *timeTitle = [NSArray arrayWithObjects:NSLocalizedString(@"lifelog.rank.time.1", nil), NSLocalizedString(@"lifelog.rank.time.2", nil), NSLocalizedString(@"lifelog.rank.time.3", nil), NSLocalizedString(@"lifelog.rank.time.4", nil), nil];
[self.viewCollectionTime setButtonNumber:timeTitle.count];
[self.viewCollectionTime setSpacing:1];
[self.viewCollectionTime setArrayTitle:timeTitle];
self.viewCollectionTime.changeCurrentIndex = ^(int index){
[self callRequestToUpdateData];
};
NSArray *modeTitle = [NSArray arrayWithObjects:NSLocalizedString(@"lifelog.rank.mode.1", nil), NSLocalizedString(@"lifelog.rank.mode.2", nil), NSLocalizedString(@"lifelog.rank.mode.3", nil), NSLocalizedString(@"lifelog.rank.mode.4", nil), nil];
[self.viewCollectionMode setButtonNumber:modeTitle.count];
[self.viewCollectionMode setSpacing:1];
[self.viewCollectionMode setArrayTitle:modeTitle];
self.viewCollectionMode.changeCurrentIndex = ^(int index){
[self callRequestToUpdateData];
};
NSArray *typeTitle = [NSArray arrayWithObjects:NSLocalizedString(@"lifelog.rank.type.1", nil), NSLocalizedString(@"lifelog.rank.type.2", nil), NSLocalizedString(@"lifelog.rank.type.3", nil), NSLocalizedString(@"lifelog.rank.type.4", nil), nil];
[self.viewCollectionType setButtonNumber:typeTitle.count];
[self.viewCollectionType setSpacing:1];
[self.viewCollectionType setArrayTitle:typeTitle];
self.viewCollectionMode.changeCurrentIndex = ^(int index){
[self callRequestToUpdateData];
};
}
#pragma mark IBAction function
- (IBAction)clickButton:(UIButton *)sender {
}
#pragma mark UITableView Delegate
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
// if(_curHisList == nil || _curHisList.count == 0) {
// UILabel * noDataLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, tableView.frame.size.height)];
// noDataLabel.text = @"No data available";
// noDataLabel.backgroundColor = [UIColor clearColor];
// noDataLabel.textColor = [UIColor whiteColor];
// noDataLabel.textAlignment = NSTextAlignmentCenter;
// tableView.backgroundView = noDataLabel;
// tableView.backgroundView.layer.zPosition -= 1;
// return 0;
// }
// tableView.backgroundView = nil;
return 1;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 6;
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
RankingTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"RankCell"];
return cell;
}
#pragma mark Private function
- (void)callRequestToUpdateData {
}
|
|
77358f2e0
|
95 |
@end |