回答編集履歴
2
軽微な修正
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
struct ContentView: View {
|
18
18
|
|
19
|
-
@State var words = ["
|
19
|
+
@State var words = ["", ""]
|
20
20
|
|
21
21
|
var body: some View {
|
22
22
|
|
@@ -24,13 +24,13 @@
|
|
24
24
|
|
25
25
|
Button("Add") {
|
26
26
|
|
27
|
-
self.words.append("
|
27
|
+
self.words.append("")
|
28
28
|
|
29
29
|
}
|
30
30
|
|
31
31
|
List {
|
32
32
|
|
33
|
-
ForEach(
|
33
|
+
ForEach(words.indices, id: .self) { i in
|
34
34
|
|
35
35
|
TextField("", text: self.$words[i])
|
36
36
|
|
1
軽微な修正
test
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
ForEach(0..<words.count, id: .self) { i in
|
34
34
|
|
35
|
-
TextField("", text: self.$words[i])
|
35
|
+
TextField("", text: self.$words[i])
|
36
36
|
|
37
37
|
}
|
38
38
|
|