-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentView.swift
More file actions
64 lines (56 loc) · 1.69 KB
/
Copy pathContentView.swift
File metadata and controls
64 lines (56 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// ContentView.swift
// Stacks Coding Challenge
//
// Created by admin on 4/9/22.
//
import SwiftUI
struct ContentView: View {
@State var bookFavorite = true
@State var musicFavorite = true
@State var programmingFavorite = true
var body: some View {
VStack(alignment: .leading) {
VStack(alignment: .leading) {
Text("Hobbies")
.font(.largeTitle)
.fontWeight(.bold)
Text("The quest for a blanced life")
HStack {
Button {
bookFavorite.toggle()
} label: {
if bookFavorite {
appButtons()
} else {
bookButton()
}
}
Button {
musicFavorite.toggle()
} label: {
if musicFavorite {
appButtons(images: Image(systemName: "music.note.list"), mainText: "Music", subText: "listen, sing, dance")
} else {
musicButton()
}
}
}
}
Button {
programmingFavorite.toggle()
} label: {
if programmingFavorite {
programmingButton()
} else {
programmingButtonHeart()
}
}
}.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}