-
Notifications
You must be signed in to change notification settings - Fork 0
/
showTotalScoreViewController.swift
55 lines (44 loc) · 1.59 KB
/
showTotalScoreViewController.swift
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
//
// showTotalScoreViewController.swift
// ninetyNineMultiplication
//
// Created by 陳秉軒 on 2022/4/15.
//
import UIKit
class showTotalScoreViewController: UIViewController {
@IBOutlet weak var resultLable: UILabel!
@IBOutlet weak var resultImage: UIImageView!
@IBOutlet weak var epilogueLabel: UILabel!
var score:Int?
override func viewDidLoad() {
super.viewDidLoad()
resultLable.text = "\(score ?? 0)"
if let score = score{
if score < 60 {
resultImage.image = UIImage(named: "456")
epilogueLabel.textColor = .red
epilogueLabel.text = "不吉格"
}else if score < 90 {
resultImage.image = UIImage(named: "901")
epilogueLabel.textColor = .orange
epilogueLabel.text = "吉佳"
}else{
resultImage.image = UIImage(named: "123")
epilogueLabel.textColor = .green
epilogueLabel.text = "超吉棒"
}
}
// Do any additional setup after loading the view.
}
@IBAction func playAgain(_ sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}