質問編集履歴

2

コードが載らないため

2022/12/12 02:58

投稿

ura4
ura4

スコア14

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,12 @@
1
1
  ### 前提
2
2
 
3
3
  ListはNavigationLinkの中で使用しています。
4
+
5
+ var body: some View {
6
+ NavigationView {
7
+ List{Section(header: Text("テキスト")){ForEach(0..<self.pinned.count) {index in NavigationLink(destination: AnotherView, label: {Text(pinned[index])}}}}
8
+ }
9
+ }}
4
10
 
5
11
  ### 実現したいこと
6
12
 

1

訂正

2022/12/12 02:56

投稿

ura4
ura4

スコア14

test CHANGED
File without changes
test CHANGED
@@ -22,11 +22,11 @@
22
22
 
23
23
  struct ContentView: View {
24
24
 
25
- @State var memos = [""]
25
+ @State var pinned = [""]
26
26
 
27
27
  var body: some View {
28
28
  NavigationView {
29
- List{Section(header: Text("テキスト")){ForEach(0..<self.memos.count) {index in NavigationLink(destination: AnotherView, label: {Text(memos[index])}}}}
29
+ List{Section(header: Text("テキスト")){ForEach(0..<self.pinned.count) {index in NavigationLink(destination: AnotherView, label: {Text(pinned[index])}}}}
30
30
  }
31
31
  }}
32
32
 
@@ -52,3 +52,4 @@
52
52
  ### 補足情報(FW/ツールのバージョンなど)
53
53
 
54
54
  Xcodeはバージョン14.1です。
55
+