-
Notifications
You must be signed in to change notification settings - Fork 3
/
ContentView.swift
50 lines (43 loc) · 1.26 KB
/
ContentView.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
//
// ContentView.swift
// P16F HotProspects
//
// Created by Julian Moorhouse on 03/05/2021.
//
import SwiftUI
struct ContentView: View {
@State private var backgroundColour = Color.red
var body: some View {
VStack {
Text("Hello, world!")
.padding()
.background(backgroundColour)
Text("Change colour")
.padding()
.contextMenu {
Button(action: {
self.backgroundColour = .red
}) {
Text("Red")
Image(systemName: "checkmark.circle.fill")
.foregroundColor(.red)
}
Button(action: {
self.backgroundColour = .green
}) {
Text("Green")
}
Button(action: {
self.backgroundColour = .blue
}) {
Text("Blue")
}
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}