BreakThroughFinishViewController.m 2.21 KB
Newer Older
1
//
2
//  BreakThroughFinishViewController.m
3 4 5 6 7 8
//  Lighting
//
//  Created by 曹云霄 on 2016/12/8.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

9
#import "BreakThroughFinishViewController.h"
10

11
@interface BreakThroughFinishViewController ()
12 13 14

@end

15
@implementation BreakThroughFinishViewController
16 17 18

- (void)viewDidLoad {
    [super viewDidLoad];
曹云霄's avatar
曹云霄 committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    
    switch (self.state) {
        case NotThrough:
        {
            NSString *string = [NSString stringWithFormat:@"您的得分为%@\n\n闯关失败!",self.score];
            NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
            NSRange range = NSMakeRange(5, [self.score length]);
            [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
            [attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:35] range:range];
            self.emigratedResultLabel.attributedText = attributedString;
        }
            break;
        case Through:
        {
            NSString *string = [NSString stringWithFormat:@"您的得分为%@\n\n恭喜您,闯关成功!",self.score];
            NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
            NSRange range = NSMakeRange(5, [self.score length]);
            [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
            [attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:35] range:range];
38
            self.integralLabel.text = [NSString stringWithFormat:@"%@",self.integral];
曹云霄's avatar
曹云霄 committed
39 40 41 42 43 44 45 46 47 48 49 50 51
            self.emigratedResultLabel.attributedText = attributedString;
        }
            break;
        case Audit:
        {
            self.emigratedResultLabel.text = @"您的回答已提交\n\n请等待反馈!";

        }
            break;
            
        default:
            break;
    }
52 53 54 55 56
}


#pragma mark - 完成
- (IBAction)finishButtonClickAction:(UIButton *)sender {
曹云霄's avatar
曹云霄 committed
57
    
58 59
    if ([self.delegate respondsToSelector:@selector(finished)]) {
        [self.delegate finished];
曹云霄's avatar
曹云霄 committed
60
    }
61 62 63 64
}


@end