-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasicsofICT
More file actions
43 lines (40 loc) · 1.43 KB
/
basicsofICT
File metadata and controls
43 lines (40 loc) · 1.43 KB
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
import SwiftUI
func RandomPrompt() -> String{
let things = ["Name three hardware components of a computer", "Name three control applications", "Name three results of using technology in the workplace", "Name three types of sensors"]
return String(things.randomElement()!)
}
struct ContentView: View {
@State var GoodThing1: String = ""
@State var GoodThing2: String = ""
@State var GoodThing3: String = ""
@State var GoodThingPrompt: String = RandomPrompt()
var body: some View {
VStack {
Text("HYGGE")
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.bold()
.monospacedDigit()
.foregroundColor(.blue)
.padding()
Image("computer_programming")
.resizable()
.scaledToFit()
Text(GoodThingPrompt)
.font(.title2)
TextField("1st", text: $GoodThing1)
.padding()
.textFieldStyle(.roundedBorder)
TextField("2nd", text: $GoodThing2)
.padding()
.textFieldStyle(.roundedBorder)
TextField("3rd", text: $GoodThing3)
.padding()
.textFieldStyle(.roundedBorder)
Button("New Prompt"){
GoodThingPrompt = RandomPrompt()
}
.buttonStyle(.bordered)
.padding()
}
}
}