Skip to content

Commit dbd1648

Browse files
committed
update menu button text
1 parent d347e97 commit dbd1648

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

Chapter01 - Using the basic SwiftUI Views and Controls/04 - Buttons and Navigation/ButtonsApp/MenuButtonView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010

1111
struct MenuButtonView: View {
1212
var body: some View {
13-
Text("MenuButtons are currently available on MacOS currently")
13+
Text("MenuButtons are deprecated but available on MacOS only")
1414
.padding()
1515
.navigationBarTitle("MenuButtons", displayMode: .inline)
1616
/*

Chapter01 - Using the basic SwiftUI Views and Controls/11 - More Views and Controls/MoreViewsAndControls/ContentView.swift

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ struct ContentView: View {
1616
var body: some View {
1717
List{
1818
Section(header: Text("ProgressViews")) {
19-
ProgressView("Indefinite progress view")
19+
ProgressView("Indeterminate progress view")
2020
ProgressView("Downloading",value: progress, total:2)
21-
Button("More", action: { progress += 0.5 })
21+
Button("More"){
22+
if(progress < 2){
23+
progress += 0.5
24+
}
25+
26+
}
2227
}
2328
Section(header: Text("Labels")) {
2429
Label("Slow ", systemImage: "tortoise.fill")
@@ -35,7 +40,9 @@ struct ContentView: View {
3540
}
3641
Section(header: Text("ColorPicker")) {
3742
ColorPicker(selection: $color ){
38-
Text("Pick my background").background(color).padding()
43+
Text("Pick my background")
44+
.background(color)
45+
.padding()
3946
}
4047
ColorPicker("Picker", selection: $secondColor )
4148
}
@@ -48,12 +55,21 @@ struct ContentView: View {
4855
}
4956
Section(header: Text("Menu")) {
5057
Menu("Actions") {
51-
Button("Set TextEditor to 'today'", action: {
52-
someText = "Reset"
53-
})
54-
Button("Turn first picker green", action: {
58+
Button("Set TextEditor text to 'magic'"){
59+
someText = "magic"
60+
}
61+
Button("Turn first picker green") {
5562
color = Color.green
56-
})
63+
}
64+
Menu("Actions") {
65+
Button("Set TextEditor text to 'magic'"){
66+
someText = "magic"
67+
}
68+
Button("Turn first picker green") {
69+
color = Color.green
70+
}
71+
72+
}
5773
}
5874
}
5975
}.listStyle(GroupedListStyle())

0 commit comments

Comments
 (0)