GiGaMaskTime/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m

107 lines
3.4 KiB
Objective-C

//
// MaskTestResultVC.m
// GIGA
//
// Created by lianxiang on 2018/9/13.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "MaskTestResultVC.h"
#import "MaskResultMinViewCell.h"
#import "MaskResultPercentCell.h"
#import "MaskResultShareViewCell.h"
@interface MaskTestResultVC ()
@end
@implementation MaskTestResultVC
- (void)viewDidLoad {
[super viewDidLoad];
[self addNavTitile:@"测试结果"];
// Do any additional setup after loading the view.
[self.view addSubview:self.tableView];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
self.tableView.sectionFooterHeight = 0;
self.tableView.estimatedSectionFooterHeight= 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.frame = CGRectMake(0,0, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT);
[self.tableView registerClass:[MaskResultPercentCell class] forCellReuseIdentifier:@"MaskResultPercentCell"];
[self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"];
[self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
static NSString *cellID = @"MaskResultPercentCell";
MaskResultPercentCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[MaskResultPercentCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];;
}
[cell loadCellData:self.model];
return cell;
}else if (indexPath.row == 1){
static NSString *cellID = @"MaskResultMinViewCell";
MaskResultMinViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[MaskResultMinViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];;
}
[cell loadMineWith:self.model.minute];
return cell;
}else if (indexPath.row == 2){
static NSString *cellID = @"MaskResultShareViewCell";
MaskResultShareViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[MaskResultShareViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];;
}
[cell kidTitle:self.model.mask];
return cell;
}
return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
CGFloat viewH = KMainH - SAFE_NAV_HEIGHT;
CGFloat cellH = viewH / 3 ;
return cellH;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0.1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ return 0.1;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end