-
Notifications
You must be signed in to change notification settings - Fork 0
/
ThirdViewController.swift
52 lines (36 loc) · 1.78 KB
/
ThirdViewController.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
//
// ThirdViewController.swift
// SayIt-Proto1
//
//
import UIKit
class ThirdViewController: UIViewController {
@IBOutlet weak var resultTextView: UITextView!
@IBOutlet weak var SomethingBtn: UIButton!
var topicType: String = ""
var resultName: String = ""
var resultTopic: String = ""
var resultEnemy: String = ""
var resultDo: String = ""
@IBAction func backToMainButton(_ sender: Any) {
performSegue(withIdentifier: "backToMain", sender: self)
}
override func viewDidLoad() {
super.viewDidLoad()
self.resultTextView.layer.cornerRadius = 9
checkOptionRes()
}
func checkOptionRes(){
if (topicType == "type1") {
resultTextView.text = "Hello, My name is \(resultName), I am \(resultTopic) years old, I am from \(resultEnemy), and I am a \(resultDo)"
} else if (topicType == "type2") {
resultTextView.text = "I would like to tell you about \(resultName), that happened \(resultTopic), it's \(resultEnemy) and I feel \(resultDo)"
} else if (topicType == "type3") {
resultTextView.text = "Excuse me, regarding \(resultName), would you : a. Explain regarding \(resultTopic). b. Tell me regarding \(resultEnemy), I didn't quite catch what you said. c. Give your opinion about \(resultEnemy)."
} else if (topicType == "type4") {
resultTextView.text = "In my opinion, regarding \(resultName), I \(resultTopic) because \(resultEnemy) as explained on \(resultDo)"
} else if (topicType == "type5") {
resultTextView.text = "I am sorry \(resultName), I was wrong when I \(resultTopic), I won't do it again, and I will make it up by \(resultEnemy), will \(resultName) forgive me?"
}
}
}