@@ -81,47 +81,54 @@ struct ControlsApp: App {
8181 Text ( " Value: \( text) " )
8282 }
8383
84- VStack {
85- Text ( " Drop down " )
86- HStack {
87- Text ( " Flavor: " )
88- Picker ( of: [ " Vanilla " , " Chocolate " , " Strawberry " ] , selection: $flavor)
89- Toggle ( " Enable ProgressView resizability " , active: $isProgressViewResizable)
90- Slider ( $progressViewSize, minimum: 10 , maximum: 100 )
91- Button ( " Randomize progress view size " ) {
92- progressViewSize = Int . random ( in: 10 ... 100 )
93- }
94- ProgressView ( )
95- . resizable ( isProgressViewResizable)
96- . frame ( width: progressViewSize, height: progressViewSize)
97-
9884 VStack {
9985 Text ( " Drop down " )
10086 HStack {
10187 Text ( " Flavor: " )
10288 Picker (
10389 of: [ " Vanilla " , " Chocolate " , " Strawberry " ] , selection: $flavor)
90+ Toggle (
91+ " Enable ProgressView resizability " ,
92+ active: $isProgressViewResizable)
93+ Slider ( $progressViewSize, minimum: 10 , maximum: 100 )
94+ Button ( " Randomize progress view size " ) {
95+ progressViewSize = Int . random ( in: 10 ... 100 )
96+ }
97+ ProgressView ( )
98+ . resizable ( isProgressViewResizable)
99+ . frame ( width: progressViewSize, height: progressViewSize)
100+
101+ VStack {
102+ Text ( " Drop down " )
103+ HStack {
104+ Text ( " Flavor: " )
105+ Picker (
106+ of: [ " Vanilla " , " Chocolate " , " Strawberry " ] ,
107+ selection: $flavor)
108+ }
109+ Text ( " You chose: \( flavor ?? " Nothing yet! " ) " )
110+ }
104111 }
105- Text ( " You chose: \( flavor ?? " Nothing yet! " ) " )
106- }
107- }
108- . padding ( )
109- . disabled ( !enabled)
110- . focusable ( isFocusable)
112+ . padding ( )
113+ . disabled ( !enabled)
114+ . focusable ( isFocusable)
111115
112- Toggle ( enabled ? " Disable all " : " Enable all " , active: $enabled)
113- . padding ( )
114- . focusable ( isFocusable)
116+ Toggle ( enabled ? " Disable all " : " Enable all " , active: $enabled)
117+ . padding ( )
118+ . focusable ( isFocusable)
115119
116- Toggle (
117- isFocusable
118- ? " Disable focusability for all " : " Enable focusability for all " ,
119- active: $isFocusable
120- )
121- . padding ( )
122- . focusable ( isFocusable)
120+ Toggle (
121+ isFocusable
122+ ? " Disable focusability for all "
123+ : " Enable focusability for all " ,
124+ active: $isFocusable
125+ )
126+ . padding ( )
127+ . focusable ( isFocusable)
128+ }
129+ . frame ( minHeight: 600 )
130+ }
123131 }
124- . frame ( minHeight: 600 )
125132 }
126133 } . defaultSize ( width: 400 , height: 600 )
127134 }
0 commit comments